The combination of molecularly imprinted polymer with high performance liquid chromatography has been developed to determine cyromazine and its metabolic melamine in some samples. However, the potential risk of template leakage used in molecularly imprinted polymer is a major disadvantage. To solve this problem, 2-(4,6-diamino-1,3,5-triazin-2-ylamino) ethanethiol disulfide, a molecule that shares the similar imprinting sites with cyromazine and melamine, was selected as pseudo template to prepare molecularly imprinted polymer. Methacrylic acid, ethylene glycol dimethyl acrylate and toluene were selected as functional monomer, crosslinker and porogen, respectively. The molecular recognition property and binding capability of cyromazine and melamine were evaluated by adsorption test and Scatchard analysis. The results showed that the molecularly imprinted polymer based on pseudo template had more excellent affinity and selectivity for cyromazine and melamine. The resulting molecularly imprinted polymer was used as a solid-phase extraction material to enrich cyromazine and melamine in egg and milk samples for high performance liquid chromatography analysis. The solid-phase extraction process was carefully optimized. It was found that when different concentration of cyromazine and melamine standards were spiked into samples, satisfactory recovery rate of cyromazine and melamine were obtained as 85.6-98.8% with relative standard deviation <5.5%.