Does anybody have idea how they would automate opening and closing links on Github page of your project? So basically I wanted to automate opening and closing all the links on my Github page just to make sure none of the links are broken. Idea is it would open a link one by one (there are hundreds of links) and if the link is opened successfully it would close it and go to the next one if the link is broken it would print that link is broken and would continue to the next one.
I tried to do this in Selenium but for some reason Selenium was giving me a error that element is not interactable. I tried to find solution online but I did not have any luck. So I decided to try here maybe someone has any solution or something I would be thankful
driver.get("https://github.com/project")
links = driver.find_elements_by_xpath('//*[@href]')
for link in links:
link.click()
Here is the error:
File "d:\Python\test.py", line 15, in <module>
link.click()
File "C:\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "C:\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
I didn't even get to the part where I would close the tab and print error since I am failing on first step