The invention relates to a method for preparing a composite photocatalyst CdS / ZIF-8 by a one-pot method, which comprises the steps of S1, dissolving
alcohol-soluble
zinc salt and
cadmium salt in
methanol, stirring until the solution is clear and transparent to obtain a first solution, dissolving 2-methylimidazole in
methanol, and stirring until the solution is clear and transparent to obtain a second solution; S2, quickly pouring the second solution into the first solution, stirring to obtain a
mixed solution, and standing and reacting the
mixed solution for a period of time; S3, adding
alcohol-soluble
sulfide into the
mixed solution, and reacting while stirring; and S4, after the reaction is finished, separating precipitates, washing and
drying to obtain the composite photocatalyst CdS / ZIF-8. The method has the advantages of few steps and simple process, and is suitable for industrial application. Experiment tests find that compared with pure CdS, the prepared CdS / ZIF-8 composite catalyst shows more excellent
hydrogen production performance and
cycling stability, the CdS / ZIF-8 composite catalyst has a wide industrial application prospect, and an important reference basis is provided for catalyst design.