具有 Xpath 目标按钮点击的 Selenium Web 自动化,是否有更高性能的方法?

Selenium web automation with Xpath targeting button clicks, is there a more performant method?

我编写了一个 C# 界面来通过自动点击工作板上的某些按钮来发送简历和求职信。我的 Xpath 就像 //button[@title=1-Click Apply]

他们一定是更改了按钮的 xpath,因为 6 个月后,它根本不执行。那时,每页​​需要 3 秒来收集按钮列表,然后重复每个按钮的点击。发送 10000 份简历大约需要 2 分钟,但我有很多人想使用该服务,我发送简历的速度不够快。有没有更好的方法来重写它以使其性能更高或拥有有效的 xpath?我现在拥有的 xpath 应该针对此按钮,但它不是。

<button class="job_tool job_apply default" 
data-interview="0" data-oneclick="" data-contact="" data-job="0" 
 data-href="https://www.ziprecruiter.com/clk/horizontal-integration-f0b9b05c-sr-software-engineer-tester-
15821-f7703d07?clk=VliBhk7_SO">1-Click Apply</button>

您的文本“1-Click Apply”不属于属性 "title"。尝试将您的 xpath 更改为://button[text()="1-Click Apply"]