Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98312

Selenium Webdriver Code Snippet for broken Links

$
0
0

I was trying to use the following code snippet to verify if all the links are working or not

links = driver.find_elements_by_css_selector("a") for link in links: if requests.head(link.get_attribute('href')).status_code == 200: print("valid link") else: print("Broken Link")

It gives me this error message in the console: raise InvalidSchema("No connection adapters were found for '%s'" % url) requests.exceptions.InvalidSchema: No connection adapters were found for 'javascript:window.print()'


Viewing all articles
Browse latest Browse all 98312

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>