无法搜索网页上的元素。升级到现代浏览器

时间:2018-06-14 14:07:51

标签: python-3.x selenium-webdriver selenium-chromedriver

我正在尝试使用python selenium访问网页,下面是我的代码。

from selenium import webdriver

options = webdriver.ChromeOptions()

tgt = "C:\\Users\\mypath"
profile = {"plugins.plugins_list": [{"enabled":False, "name":"Chrome PDF Viewer"}],
    "download.default_directory" : tgt}
options.add_experimental_option("prefs",profile)

driver = webdriver.Chrome(executable_path=r'C:\chromedriver_win32\chromedriver.exe', chrome_options=options)
driver.implicitly_wait(30)

driver.get("https://mylink")
uname = driver.find_element_by_name("UserName")
pwd = driver.find_element_by_name("Password")
uname.send_keys("@.com")
pwd.send_keys("Pwd")
driver.find_element_by_xpath('//*[@id="submitButton"]').click()

虽然我可以访问该网页,但它以下面的格式显示,但出现以下错误。

www.aaa.com uses several advanced Web technologies for you to search and request AAA. Currently we support most modern browsers and Internet Explorer 9 and up.

Use a modern browser to start requesting AAA now!

Although our website supports Internet Explorer 9, we recommend you upgrade your browser to a newer version for a better experience.

enter image description here

有关此类问题的任何帮助。我在我的电脑上有最新的浏览器,如果我手动使用它而不是通过python selenium,那么同一个网站的效果非常好。

0 个答案:

没有答案