A polymer is imprinted with an agricultural chemical molecule having a heterocyclic ring, wherein the matrix of said polymer has been prepared from one or more monomers including bilirubin or a mono-or di-ester or amide thereof, and wherein the heterocyclic ring has 1-3 nitrogen atoms. The imprinted polymer is useful for removing agricultural chemicals from liquids including waste water, drinks and food ingredients.