Javascript Python webdriver Htmlunit//Find_element_by_id使我出错
我想Javascript Python webdriver Htmlunit//Find_element_by_id使我出错,javascript,python,selenium,paypal,htmlunit-driver,Javascript,Python,Selenium,Paypal,Htmlunit Driver,我想通过paypal上的\u id查找\u元素\u,以确认结帐,但我得到一个错误。 我使用webdriver Chrome和Opera的工作代码: confirmButton = browser.wait.until( EC.presence_of_element_located((By.ID, "confirmButtonTop")) ) confirmButton.click() 我想将它与HTMLUnit和PhantomJS一起使用,但它不起作用。我尝试过使用不同的方法,但没有: t
通过paypal上的\u id查找\u元素\u
,以确认结帐,但我得到一个错误。
我使用webdriver Chrome和Opera的工作代码:
confirmButton = browser.wait.until(
EC.presence_of_element_located((By.ID, "confirmButtonTop"))
)
confirmButton.click()
我想将它与HTMLUnit
和PhantomJS
一起使用,但它不起作用。我尝试过使用不同的方法,但没有:
try:
WebDriverWait(driver, delay).until(EC.presence_of_element_located(
driver.find_element_by_id('confirmButtonTop'))
)
print "Page is driver!"
except TimeoutException:
print "Loading took too much time!"
或:
同样的错误:
找不到ID为confirButtonP的元素
HTML:
html代码:您能描述一下流程吗?您想实现什么目标?此外,在编辑器中使用StackOverflow样式控件也会大有帮助。。
confirmButton = driver.find_element_by_id("confirmButtonTop")
confirmButton.click()
<div id="button" class="buttons reviewButton">
<input track-submit="" type="submit" value="Continuer" id="confirmButtonTop"
class="btn full confirmButton continueButton" validate-submit="onPay()">
</div>