![](/img/trans.png)
[英]How to scroll down to end of the dynamic page using selenium python chromeDriver
[英]Selenium Python get height of PDF using Chromedriver
我正在尝试使用 Chromedriver Selenium + Python 获取 pdf 文件的滚动高度。 这是代码:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.adobe.com/content/dam/acom/en/accessibility/products/acrobat/pdfs/acrobat-x-accessibility-checker.pdf")
total_height = driver.execute_script("return Math.max( document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight );")
output 是925
但是,总滚动高度应该大于 pdf 有 7 页......想法?
我得到 969:
return $('[type="application/pdf"]').scrollHeight
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.