![](/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.