LambdaTest Community

Find answers, support, and inspiration from other users

Questions
LambdaTest Community
Answered

How can I find broken links in website using Selenium Webdriver?

Can anyone tell me some way on how can I find broken links in website using Selenium Webdriver.

Up Vote Down Vote 0 Votes
Posted 4 months ago

Answers


It's simple

Step 1 : Open the link using browser.get() method

Step 2: Find all the anchor tags and check for null or empty in the href attribute.

Another way to find out is using the http code by maing the request tot each URLs and find out the http code using request method or any http client.

Up Vote Down Vote 0 Votes
Posted 2 months ago