In this modest work, a local biopolymer (CHA), biodegradable, non-toxic, and soluble in acidic media, was extracted from the plant Artemisia herba-alba located in the eastern region of Morocco, and characterized by FT-IR, in order to valorize it as a corrosion inhibitor of mild steel in 1 M HCl medium. The electrochemical tests show that the extract is an excellent corrosion protective agent, reaching a maximum value of 96.17% at the concentration of 800 mg/L in the inhibitor. The potentiodynamic polarization (PDP) curves indicate the mixed behavior of the extract, to reduce the current density from 3.445 mA/cm2 to 0.104 mA/cm2 in the presence of 800 mg/L in the inhibitor. The biopolymer CHA of the extract of Artemisia herba-alba undergoes the Langmuir adsorption isotherm, whose adsorption energy is −20.75 kJ/mol, which is attributed to the presence of electrostatic and covalent bonds. In addition, the visualization of the metal surface by a scanning electron microscope (SEM) indicates the formation of a protective layer formed by the extracts of Artemisia herba-alba, which confirms the protective characteristic of the extract used. Theoretical investigations by DFT, MD, and MC confirm previous experimental results.