Abstract A novel approach for assembling homogeneous hyperbranched polymers based on non-covalent interactions with aflatoxins was developed; the polymers were used to evaluate the extraction of aflatoxins B1, B2, G1 and G2 (AFB1, AFB2, AFG1 and AFG2) in simulant solutions. The results showed that the extraction efficiencies of three kinds of synthesized polymers for the investigated analytes were not statistically different; as a consequence, one of the representative polymers (polymer I) was used as the solid-phase extraction (SPE) sorbent to evaluate the influences of various parameters, such as desorption conditions, pH, ionic strength, concentration of methanol in sample solutions, and the mass of the sorbent on the extraction efficiency. In addition, the extraction efficiencies for these aflatoxins were compared between the investigated polymer and the traditional sorbent C18. The results showed that the investigated polymer had superior extraction efficiencies. Subsequently, the proposed polymer for the SPE packing material was employed to enrich and analyze four aflatoxins in the cereal powder samples. The limits of detection (LODs) at a signal-to-noise (S/N) ratio of 3 were in the range of 0.012–0.120ngg−1 for four aflatoxins, and the limits of quantification (LOQs) calculated at S/N=10 were from 0.04 to 0.40ngg−1 for four aflatoxins. The recoveries of four aflatoxins from cereal powder samples were in the range of 82.7–103% with relative standard deviations (RSDs) lower than 10%. The results demonstrate the suitability of the SPE approach for the analysis of trace aflatoxins in cereal powder samples.