【发布时间】:2017-12-15 18:01:51
【问题描述】:
<iframe src="https://authedmine.com/authenticate.html?key=tqao2dYaXfMVJuUNUIwh6OBUUGSW3omn&domain=mining.freebitco.in&theme=light&lang=auto" style="border: none; width: 380px; height: 412px; max-width: 100%; max-height: 100%; position: absolute; overflow: auto; left: 0px; right: 0px; top: 0px; bottom: 0px; margin: auto;"></iframe>
<body class="light">
<div id="content" style="display: block;">
<a id="set-english-locale" href="#" style="display: block;">English</a>
<h1 id="head">xx</h1>
<p id="body">yy.</p>
<p class="warn" id="batteryWarning">Not:cc.</p>
<div class="actions">
<button class="allow" id="accept">Bu oturum için izin ver</button> --Need click this--
<button class="cancel" id="cancel">İptal</button>
</div>
<p class="foot">
powered by
<a href="asdadad.com" class="icon">
coinhive
</a>
–
<a href="https://coinhive.com/info/opt-in" target="_blank">more info</a>
</p>
我得到了这个错误;
“OpenQA.Selenium.WebDriverException”类型的未处理异常 发生在 WebDriver.dll 附加信息:HTTP 请求 URL 的远程 WebDriver 服务器 http://localhost:57885/session/233d4589882afe49d8dd64d1f9318ac0/element 60 秒后超时。
我想点击按钮,但我不能点击..我尝试了很多代码,但我不能:(我停止了这个代码。请帮助我。
最后我点击 :D 非常感谢@DebanjanB
driver.SwitchTo().Frame(driver.FindElement(By.XPath("/html/body/div[2]/iframe")));
driver.FindElement(By.XPath("//*[@id='accept']")).Click();
driver.SwitchTo().DefaultContent();
【问题讨论】:
-
你能分享错误跟踪吗?
-
WebDriver.dll 中发生了“OpenQA.Selenium.WebDriverException”类型的未处理异常附加信息:对远程 WebDriver 服务器的 HTTP 请求以获取 URL。我收到此错误
标签: javascript html selenium popup popupwindow