I
I
Ilya2020-08-31 19:05:03
Python
Ilya, 2020-08-31 19:05:03

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)


5f4d1f9347caf859289467.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question