I'm working on a task, that I could scan all href links of a website and get the data from them.
Now I have the following code:
Originally I get to the first webpage, and navigate to several links by driver.get(link)
But it seems some link would navigate to external website, and cause the error:
It seems if the driver navigate to external website, the DOM could no longer find the web elements containing the links I set before the loop.
How could I deal with the problem? A stupid method I'd think of is to get back to the original URL everytime after a link is get by driver.
Thank you for any help!