我一直在尝试使用Selenium WebDriver查找以下按钮:
<div class="_1gw6tte">
<div aria-hidden="false">
<div class="_159vfsnv" style="background-color: transparent;">
<div class="_12to336">
<div class="_1ibtygfe">
<button type="button" class="_pmpl8qu">
Afficher plus de résultats</button>
</div>
</div>
</div>
</div>
</div>
我使用了css选择器、xpath和类,但似乎什么都不起作用(即使只是复制粘贴检查器给出的一个。最近的一次是用类_1ibtygfe定位div) 这是我试过的所有东西,我绝望了,我不明白为什么它找不到它,它总是给我一个没有这样的元素例外
wd.get(url)
print(wd.current_url) #check
#wd.find_element_by_xpath('//[@id="ExploreLayoutController"]/div[1]/div[2]/div[1]')#/div/div/div/button') #xpath given by inspector
#wd.find_element_by_class_name('_pmpl8qu')
#wd.find_element_by_xpath("//div[@class = '_1ibtygfe']/button[@class = '_pmpl8qu']")
#wd.find_element_by_xpath("//div[@class = '_1ibtygfe']/button")
#wd.find_elements_by_css_selector('button._pmpl8qu')
这是airbnb网站,我正试图浏览他们的活动并点击查看更多按钮。谢谢你的帮助
看看这是否有效
如果要单击此按钮,需要
详情如下:
相关问题 更多 >
编程相关推荐