from selenium import webdriver import selenium # # print(selenium.__version__) # print(selenium.webdriver) driver = webdriver.Chrome(executable_path=r"D:\softs\chrome\ChromeCore") driver.get("https://www.baidu.com") input = driver.find_element_by_css_selector('#kw') input.send_keys("天堂的张望") button = driver.find_element_by_css_selector('#su') button.click()
Traceback (most recent call last):
File "C:\Users\***\AppData\Roaming\Python\Python38\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "D:\softs\python3.8\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\softs\python3.8\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
PermissionError: [WinError 5] 拒绝访问。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/***/Desktop/spideframer/testing2.py", line 11, in <module>
driver = webdriver.Chrome(executable_path=r"D:\softs\chrome\ChromeCore")
File "C:\Users\***\AppData\Roaming\Python\Python38\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
self.service.start()
File "C:\Users\***\AppData\Roaming\Python\Python38\site-packages\selenium\webdriver\common\service.py", line 86, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'ChromeCore' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home