python - 如何在 selenium python 中获取当前滚动高度

标签 python selenium web-scraping selenium-chromedriver

我想在 selenium python 中获取当前滚动高度 比如如果我在堆栈溢出的中间滚动,所以我想要在 python 中使用 selenium 的当前滚动高度 谢谢 这个我试过了

height =  browser.execute_script("return document.body.scrollHeight")

最佳答案

试试这个:

height = browser.execute_script("return document.documentElement.scrollHeight")

关于python - 如何在 selenium python 中获取当前滚动高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61877719/

相关文章:

python - 网页抓取:访问大列表中的文本信息

python - Scrapy - 为 gif 制作网络爬虫

python - Pandas:帮助转换数据和编写更好的代码

r - 使用 RSelenium 在 Firefox 中设置地理位置

python - 遍历帐号列中的每一行并使用它们读取其他 Excel 文件

Python Selenium : How do I click a link in a drop down menu with css selector?

python - google-chrome 无法在 flask 应用程序中以 Selenium 开头

Rvest:抓取多个 URL

python - 为什么 python 不支持 : while( s = f. readline())?

python - 定义跨多个模型的关系 - Django