我想在paypal上Find_element_by_id
以确认结帐,但我收到了错误消息。
我使用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!"
或:
confirmButton = driver.find_element_by_id("confirmButtonTop")
confirmButton.click()
同样的错误:
无法找到ID为:confirmButtonTop
的元素
HTML:
<div id="button" class="buttons reviewButton">
<input track-submit="" type="submit" value="Continuer" id="confirmButtonTop"
class="btn full confirmButton continueButton" validate-submit="onPay()">
</div>