Python Selenium with Phantomjs-单击失败:ReferenceError:Cant';找不到变量

Python Selenium with Phantomjs-单击失败:ReferenceError:Cant';找不到变量,python,selenium-webdriver,phantomjs,Python,Selenium Webdriver,Phantomjs,我正在编写一个python脚本,使用SeleniumWebDriver从网站获取一些数据,然后 我正在尝试单击网页中的“下一步”按钮。定义按钮的位置: <a id="ctl00_FullRegion_npsGridView_lnkNext" class="nextCol" href="javascript:__doPostBack('ctl00$FullRegion$npsGridView$lnkNext','')">Next</a> 这在使用Firefox或Chrom

我正在编写一个python脚本,使用SeleniumWebDriver从网站获取一些数据,然后 我正在尝试单击网页中的“下一步”按钮。定义按钮的位置:

<a id="ctl00_FullRegion_npsGridView_lnkNext" class="nextCol" href="javascript:__doPostBack('ctl00$FullRegion$npsGridView$lnkNext','')">Next</a>
这在使用Firefox或ChromeWebDriver时效果很好,但在使用Phantomjs时,我会遇到以下错误

selenium.common.exceptions.WebDriverException: Message: u'Error Message => \'Click          
failed: ReferenceError: Can\'t find variable: __doPostBack\'\n caused by Request

这个错误在很多谷歌搜索中都会出现,但在使用phantomjs时,还没有真正找到解决方法

尝试发送不同的用户代理标头:

from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

user_agent = (
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) " +
    "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36"
)

dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = user_agent

browser = webdriver.PhantomJS(desired_capabilities=dcap)

从这个。请尝试调用“submit”方法,然后告诉我?已尝试此方法。谢谢你。submit没有给出错误,但将整个html表留空。