可以使用find_element_by_xpath在selenium python中找到按钮标记

时间:2017-08-29 07:17:13

标签: python selenium button xpath web-crawler

HTML:

<button aria-expanded="false" class="pv-profile-section__see-more-inline link" data-ember-action data-ember-action-2611="2611">

的Python:

 buttons = browser.find_elements_by_xpath(u'//button[@class="pv-profile-section__see-more-inline link"]')
    print(buttons)
    for degree in buttons:
        degree.click()

上面有两个带有相同标签的按钮,但它不能访问其中任何一个。它只打印空列表。

0 个答案:

没有答案