【发布时间】:2017-02-28 17:54:01
【问题描述】:
有没有人知道如何使用 selenium 在 Python 中查找/单击类似 YT 的按钮,因为它没有真正的 Id 等...
感谢您的回答
【问题讨论】:
-
使用 CSS 选择器或 Xpath
标签: python selenium button youtube
有没有人知道如何使用 selenium 在 Python 中查找/单击类似 YT 的按钮,因为它没有真正的 Id 等...
感谢您的回答
【问题讨论】:
标签: python selenium button youtube
您可以像这样使用 CSS 选择器进行选择:
如果你想like:
#watch8-sentiment-actions > span > span:nth-child(1) > button
如果你想取消like:
#watch8-sentiment-actions > span > span:nth-child(2) > button
【讨论】:
find_element_by_css_selector。