【发布时间】:2020-07-21 19:32:20
【问题描述】:
目前,我使用 selenium 自动化了一些流程,需要解决 Google ReCaptcha。 用于解决 ReCaptcha 的技术是浏览器 Plugin Buster。 我使用以下输入 Google ReCaptcha
driver.SwitchTo().Frame(0);
driver.FindElement(By.Id("recaptcha-anchor")).Click();
现在我使用以下命令切换回默认框架:
driver.SwitchTo().DefaultContent();
现在我尝试使用以下代码进入 Google ReCaptcha 菜单框架并单击 Buster 图标。
driver.SwitchTo().Frame(Indexoftheframetoenter);
driver.FindElement(By.CssSelector("#solver-button")).Click();
问题是,索引似乎是一个随机的小数字,这导致我的代码没有点击图标。我设法用丑陋的 try and catch 块“解决”了这个问题,覆盖了特定数量的数字。我不熟悉 iFrame。有没有办法猜测这个特定的 iFrame?
非常感谢
【问题讨论】: