A mechanics‐informed artificial neural network approach for learning constitutive laws governing complex, nonlinear, elastic materials from strain–stress data is proposed. The approach features a robust and accurate method for training a regression‐based model capable of capturing highly nonlinear strain–stress mappings, while preserving some fundamental principles of solid mechanics. In this sense, it is a structure‐preserving approach for constructing a data‐driven model featuring both the form‐agnostic advantage of purely phenomenological data‐driven regressions and the physical soundness of mechanistic models. The proposed methodology enforces desirable mathematical properties on the network architecture to guarantee the satisfaction of physical constraints such as objectivity, consistency (preservation of rigid body modes), dynamic stability, and material stability, which are important for successfully exploiting the resulting model in numerical simulations. Indeed, embedding such notions in a learning approach reduces a model's sensitivity to noise and promotes its robustness to inputs outside the training domain. The merits of the proposed learning approach are highlighted using several finite element analysis examples. Its potential for ensuring the computational tractability of multi‐scale applications is demonstrated with the acceleration of the nonlinear, dynamic, multi‐scale, fluid‐structure simulation of the supersonic inflation dynamics of a parachute system with a canopy made of a woven fabric.