Answer the question
In order to leave comments, you need to log in
How to defeat the parsing of this page in selenium?
there is a page:
https://catalog.usmint.gov/coins/coin-programs/america-the-beautiful-quarters-program
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import WebDriverWait
from time import sleep
wb_link = webdriver.Chrome(ChromeDriverManager().install())
wb_link.get('https://catalog.usmint.gov/coins/coin-programs/america-the-beautiful-quarters-program/')
sleep(2)
wb_link.execute_script("window.scrollTo(0, 100);")
sleep(1)
wb_link.execute_script("window.scrollTo(100, 500);")
sleep(1)
wb_link.execute_script("window.scrollTo(500, 1000);")
sleep(1)
wb_link.execute_script("window.scrollTo(1000, 1500);")
sleep(1)
wb_link.execute_script("window.scrollTo(1500, 2000);")
WebDriverWait(wb_link, 10).until(lambda driver: driver.execute_script('return document.readyState') == 'complete')
Answer the question
In order to leave comments, you need to log in
For the sake of interest, I decided to try it, everything is fine with me, only I used mozilla. So most likely the problem is not in the site.
from selenium import webdriver
from time import sleep
driver = webdriver.Firefox("./")
driver.get('https://catalog.usmint.gov/coins/coin-programs/america-the-beautiful-quarters-program/')
sleep(2)
driver.execute_script("window.scrollTo(0, 100);")
sleep(1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question