Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法在WinServer 2012上使用selenium webdriver从ie获取元素_Python_Internet Explorer_Selenium_Webdriver_Internet Explorer 10 - Fatal编程技术网

Python 无法在WinServer 2012上使用selenium webdriver从ie获取元素

Python 无法在WinServer 2012上使用selenium webdriver从ie获取元素,python,internet-explorer,selenium,webdriver,internet-explorer-10,Python,Internet Explorer,Selenium,Webdriver,Internet Explorer 10,我正在使用selenium 2.33,在windows server 2012上使用Python的IEDriveServer 我无法使用WebDriver获取任何元素 例如: from selenium import webdriver driver=webdriver.Ie() driver.get('http://www.google.com') driver.find_element_by_name('q') IE窗口已成功打开,但提取元素未成功。 我得到一个错误: 找不到name=q的

我正在使用selenium 2.33,在windows server 2012上使用Python的IEDriveServer

我无法使用WebDriver获取任何元素

例如:

from selenium import webdriver
driver=webdriver.Ie()
driver.get('http://www.google.com')
driver.find_element_by_name('q')
IE窗口已成功打开,但提取元素未成功。 我得到一个错误:

找不到name=q的元素

我甚至试着用不同的页面
按\u id
查找\u元素


我的脚本在win7和win8上运行,但在winserver2012上它不在ie10上运行这是Java中的一个示例,但我认为它也应该在python上运行。我遇到了类似的情况,xpath或id的findElement在IE9上不起作用。所以我尝试使用cssSelector,效果很好。不确定python的语法是什么,但在Java中它看起来像以下内容,希望这有帮助
driver.findElement(By.cssSelector(选择器))

一些事情:更新到最新版本的Selenium,检查受保护模式设置,查看32位/64位IE是否有任何不同的结果。但是按id抓取应该可以正常工作吗?我怀疑这是否与Windows2012上的IE10设置有关,因为selenium获取元素是基于javascript工作的。如果我错了,请纠正我。无论如何,我无法解决这个问题,所以我正在寻求帮助。我有混合的ID的经验,所以不能真的说它将工作或不工作。你试过css选择器吗?我应该用id来做。所以我很困惑为什么它不能在WinServer2K12上工作。