【发布时间】:2018-04-12 04:53:09
【问题描述】:
我正在尝试将点击发送到一个元素,但它不起作用。
我在 python 3.6 中使用 selenium 并且元素是
<a class="_m3m1c _1s3cd" href="#" role="button">Load more comments</a>
我的代码:
post = browser.find_element_by_class_name('_ebcx9')
comment_list = post.find_element_by_tag_name('ul')
comments = comment_list.find_elements_by_tag_name('li')
我试过了
ActionChains(browser).move_to_element_with_offset(comments[1], 5, 5).click().perform
甚至
ActionChains(browser).click(comments[1].find_element_by_tag_name('a')).perform()
我做错了什么?
请帮帮我。
【问题讨论】:
标签: css python-3.x selenium selenium-webdriver xpath