gpt4 book ai didi

python selenium 单击链接按钮

转载 作者:太空宇宙 更新时间:2023-11-04 00:53:11 26 4
gpt4 key购买 nike

我对 python selenium 很陌生,我想点击一个具有以下 html 结构的按钮:

<a href="#" onclick="loadCalendarsForDateFn('jmpto1605')"><span class="jumpToMonthMM">May</span><span class="jumpToMonthYY">2016</span></a><br/>

我希望能够点击上面的“2016 年 5 月”按钮。有人可以指导我怎么做吗?

提前致谢!

最佳答案

您可以使用 XPath 检查月份和年份:

//a[span[@class="jumpToMonthMM"] = "May" and
span[@class="jumpToMonthYY"] = "2016"]

关于python selenium 单击链接按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36227344/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com