A method for preparing compound 1 and compound 2 having a structure as shown below, the method includes the following steps:1) subjecting 2,3-dihydrobenzofuran-7-amine as a
raw material to a selective-dibromination with a brominating
reagent to obtain 4,6-dibromo-2,3-dihydrobenzofuran-7-amine;2) subjecting 4,6-dibromo-2,3-dihydrobenzofuran-7-amine obtained in the step 1) to
Sandmeyer reaction for chlorination to obtain 4,6-dibromo-7-chloro-2,3-dihydrobenzofuran;3-1) selectively debrominating from 4,6-dibromo-7-chloro-2,3-dihydrobenzofuran obtained in the step 2) using a strong base, and then adding a
formylation reagent to obtain compound 1;3-2) selectively debrominating from 4,6-dibromo-7-chloro-2,3-dihydrobenzofuran obtained in the step 2) using a strong base, and then reacting with 4-cyclopropyl
benzaldehyde to obtain compound 2.