It is a question for which I already have an answer, but I thought that it could be good for more than one person and in several cases. Of course, I accept new answers with other methods.
It is about being able to save the impressions of the images in an already existing site in which I cannot/must modify the src of the same because it is complex or extensive, for example.
The objective is to save a counter in the database of an image of an html with the following form:
<img src="img/foto.jpg" alt="foto">
I have the database with a table "images" and with an autonumber id, the path and name of the image and a default counter set to 0.