【问题标题】:How to scroll down one scroll down bar, if there are more如果有更多,如何向下滚动一个向下滚动条
【发布时间】:2020-04-19 05:09:06
【问题描述】:

在我的页面上,如果有更多的向下滚动条,我怎样才能找到我想要向下滚动的那个。

我的意思是,我想从中间向下滚动栏,从右边开始是浏览器栏。

如下图所示,我想移动带有黄色箭头的那个。

【问题讨论】:

  • 尝试先点击它。或者拖动它。 Example
  • 我现在正在尝试查看是否可以向下滚动类找到的元素
  • 我给你的例子使用.find_element_by_name("...")。只需将其切换为.find_element_by_class_name("your class")

标签: python python-2.7 selenium selenium-webdriver selenium-chromedriver


【解决方案1】:

我找到了解决方案,并发布了它,也许它会对某人有所帮助。

element = driver.find_elements_by_class_name('paginated')
driver.execute_script('arguments[0].scrollTop = arguments[0].scrollHeight', element[0])

Selenium Firefox webdrive, using Python, scrolling in div

【讨论】:

    猜你喜欢
    • 2018-01-01
    • 2021-09-01
    • 2016-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多