我正在尝试填写此站点上的用户名和密码框:http ://www.youwager.eu/welcome/
这是相关的html:
<input type="text" class="form-control" name="customerid" id="customerid" placeholder="Account Number">
使用 firefox 时,一个简单的 browser.fill('customerid', login) 可以工作,但我无法让 phantomJS 与元素交互。它抛出以下错误:
<class 'selenium.common.exceptions.InvalidElementStateException'> , InvalidElementStateException()
重现问题的代码:
from splinter import Browser
browser=Browser('phantomjs') #=Browser() uses firefox, and works
browser.visit('http://www.youwager.eu/welcome')
browser.fill('customerid', login)
使用 Splinter 0.5.4、Selenium 2.43.0、PhantomJS 1.9.7.0