【发布时间】:2021-02-05 08:18:13
【问题描述】:
我正在尝试向下滚动页面,因为在我单击一次按钮后,帮助元素与下一页按钮重叠,因为页面向下移动。 下一个按钮位于匹配历史表上方。 我尝试使用
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
什么都没有发生, 然后我尝试使用
element=driver.find_element_by_xpath("//table[@class='Table flx-sm dir-r-sm jst-s-sm flx-nw-sm ialgn-st-sm']")
actions = ActionChains(driver)
actions.move_to_element(element).perform()
它给了我错误:MoveTargetOutOfBoundsException: Message: (1009, 835) is out of bounds of viewport width (1536) and height (750)
我尝试过使用
html = driver.find_element_by_tag_name('html')
html.send_keys(Keys.END)
什么都没有动。这是我正在尝试的代码和网站。(我也尝试使用 Chrome,但结果相同)
driver = webdriver.Firefox()
url2="https://app.senpai.gg/lol/profile/eune/Primm"
driver.get(url2)
button = driver.find_element_by_xpath('/html/body/div[2]/div/div/section/div/section/main/div[1]/div[1]/div[6]/div/div[1]/div[2]/div/button[2]')
time.sleep(10)
while true:
if(button.is_enabled() and button.is_displayed()):
button.click();
else:
break;
【问题讨论】:
标签: python selenium scroll webdriver