A subject matter of the invention is a molecularly imprinted polymer obtained by polymerization of a mixture comprising a silane, a tetra(C1-C4)alkyl orthosilicate, a porogenic solvent and a C14-C20 fatty acid. Cosmetic composition comprising such a polymer. Cosmetic method for preventing and/or treating dandruff of the scalp using such a polymer.L'invention concerne un polymère à empreinte moléculaire obtenu par polymérisation d'un mélange constitué d'un silane, d'un orthosilicate de tétra-alkyle (C1-C4), d'un solvant porogène et d'un acide gras C14-C20. L'invention concerne également une composition cosmétique comprenant un tel polymère. Elle concerne un procédé cosmétique destiné à prévenir et/ou traiter les pellicules du cuir chevelu à l'aide d'un tel polymère.