前提・実現したいこと
seleniumを使って、chromeに色々したいのですが、
以下エラーが発生して全然動きません。。。
chromedriverがないみたいなえらーなのですが、
PATHを指定しても、まったく反応変わらず。。。????
発生している問題・エラーメッセージ
Traceback (most recent call last):
File "/home/mero/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/home/mero/.local/lib/python3.6/site-packages/chromedriver'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "auto_screen.py", line 9, in <module>
browser = webdriver.Chrome(executable_path=PATH)
File "/home/mero/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init
self.service.start()
File "/home/mero/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 88, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/ho
該当のソースコード###
[言語:Python]
'#-- coding: utf-8 --
from time import sleep
from selenium import webdriver
'#Chromeを起動
PATH = "/home/mero/.local/lib/python3.6/site-packages/chromedriver"
browser = webdriver.Chrome(executable_path=PATH)
'#表示したいサイトを開く
browser.get("https://www.google.com/")
'#表示したサイトのスクリーンショットを撮る
browser.save_screenshot("screen.png")
'#表示した瞬間消えちゃうから幅を持たせておく
time.sleep(5)
'#ブラウザを閉じる
browser.close()

回答1件
あなたの回答
tips
プレビュー