Because you often use the QR code information in a website, each time you need to manually open the site, slide to the corresponding place, click a link to open the picture, so you want to use a script to get this information. Just JS can be very convenient to manipulate the HTML DOM, so write a simple function to try hackers.
Open the Web page, open the Browser debugging tool, get the corresponding page information, found that the node can use the following function to obtain the value of the href.
JS = Document.getelementsbyclassname ("Hover-text") [4].getelementsbytagname (' a ') [0].getattribute (' href ')
The value returned by this function is the value of the href of the a tag, with the address such as "img/qr/xxx.png", but this value cannot be used directly, so we need another way. As follows:
JS = Document.getelementsbyclassname ("Hover-text") [4].getelementsbytagname (' a ') [0].href
The returned data is:
"Http://example.com/img/qr/xxx.png"
This is exactly what I want. If there is more depth, the update will continue.
Use JS to get the href value of the <a> tag in the HTML document.