Answer the question
In order to leave comments, you need to log in
Why is the page not loading when clicking on a link using Selenium?
Hello.
I am writing a parser that selects certain links from a page and saves them in a list, and then goes through the list and saves the necessary pictures from each page.
But for some reason, when I try to open a page from the list, it does not load. Why can this be so?
from selenium.webdriver import Chrome
driver = Chrome()
driver.get("https://www.houzz.com/magazine/what-to-know-before-you-paint-your-walls-white-stsetivw-vs~42332464")
elems = driver.find_elements_by_xpath("//*[@href]")
content = driver.find_elements_by_class_name('hz-editorial-gallery-main-content__item__link')
links = []
for link in content:
link = link.get_attribute("href")
links.append(link)
print(links)
page = links[1]
driver.get(page)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question