- Get link
- X
- Other Apps
Posted by
Sudheer Kumar Suggu
on
- Get link
- X
- Other Apps
There could be a scenario to extract all the URLs related to a page on the website.
Please follow below steps to read all the URLs on the page
- Go to the Google Chrome browser and type the URL in the browser.
- Once the website opens, click F12 or developer tools and click on the console tab
- Now paste the below command on the console window as shown below
urls = $$('a'); for (url in urls) console.log ( urls[url].href );
- Also, few other commands which also gives much detailed granular URL Extraction with Anchor Text (COLOURED) that on chrome and firefox browser
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;");}
- For IE and Edge browser use below command
var urls=$$('a');for(url in urls){console.log("#"+url+" - "+urls[url].innerHTML +" -- "+urls[url].href)}
Happy extracting !!
Comments
Post a Comment
Please do not enter any spam link in the comment box