0 votes
in Internet by

How To Extract URLs From A Website In Chrome?

Open Website in URL

right click on page and choose inspect

Go to console tab and use below codes:

Code for URL Extraction

urls = $$('a'); for (url in urls) console.log ( urls[url].href );

Code for URL Extraction with Anchor Text (COLOURED)(works for chrome/firefox)

var urls=$$('a');for(url in urls){console.log("%c#"+url+" - %c"+urls[url].innerHTML +" -- %c"+urls[url].href,"color:red;","color:green;","color:blue;");}

Code for URL Extraction with Anchor Text (IE/Edge)

var urls=$$('a');for(url in urls){console.log("#"+url+" - "+urls[url].innerHTML +" -- "+urls[url].href)}

Please log in or register to answer this question.

Welcome to My QtoA, where you can ask questions and receive answers from other members of the community.
...