I'm using python Selenium webdriver to open a pdf online and I want to scroll it. Which function should I use?
I already try to use the function driver.execute_script("window.scrollTo(0, 1000)") [as suggested in this stack overflow question: How can I scroll a web page using selenium webdriver in python?]
This is my code:
driver.get("http://www.pdf995.com/samples/")
element = driver.find_element_by_xpath("//a[@href='pdf.pdf']")
element.click()
driver.execute_script("window.scrollTo(0, 1000)")
I expect to scroll down (as normally it does e.g. when I tape driver.get("https://www.google.it/search?client=opera&q=google&sourceid=opera&ie=UTF-8&oe=UTF-8") but actually the page remains fixed.
Does anyone have an advice for me?