我正在尝试在 Windows 7 上的 python 中使用 selenium webdriver 打开 chrome 浏览器,但它挂起。下面是我使用的代码:
`
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.proxy import *
import time
from pprint import pprint
chromeOps = webdriver.ChromeOptions()
print "after chrome opts", chromeOps
print dir(chromeOps)
pprint(chromeOps)
chromeOps.binary_location = "C:\\Users\\cvoicu\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe"
print "after binary loc"
browser = webdriver.Chrome("C:\\Python27\\chromedriver.exe", chrome_options=chromeOps)
print "after browser", browser
print dir(browser)
browser.get("http://www.google.com")
`
你能帮我吗?谢谢!