The invention relates to the technical field of metal corrosion inhibition and particularly discloses a benzimidazoline corrosion inhibitor prepared from refined swill-cooked dirty oil, of which the chemical formula is as shown in the description, wherein R=C(16-20) saturated alkyl or unsaturated alkyl; and R1=H, CH3 and C6H5. The corrosion inhibitor is obtained in the way that saturated alkyl and unsaturated alkyl or phenyl, of different chain lengths, are added into benzimidazole molecules, so that the hydrophobicity of a protective film is improved while the density of pi electron cloud, capable of being coordinated with metals, in the molecules is increased, accordingly, the metal corrosion rate is greatly reduced, and the metal anticorrosiveness is increased. The corrosion inhibitor is an oil-soluble product, can be used for corrosion protection of oil field pipelines and industrial pickling, can form a compact and firm adsorption film on a metal surface, reduces the metal corrosion rate and achieves the purpose of metal corrosion protection.