How to handle broken links in selenium 1.Collect all the link in the webpage based on the tag. 2.Send HTTP request for the link and read HTTP response code. 3.Find out whether the link is valid or broken based on HTTP response code. 4.Repeat this fot all the links captured.
Note- Change the path for your chromedrive.exe and try it with different webpage.