PermissionError: [Errno 13] Permission denied: 'chromedriver' [duplicate] - selenium

This question already has answers here:
IOError: [Errno 13] Permission denied: 'geckodriver.log when running Python/Selenium
(3 answers)
'Webdrivers' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
(22 answers)
Selenium on MAC, Message: 'chromedriver' executable may have wrong permissions
(6 answers)
selenium.common.exceptions.WebDriverException: Message: 'library' executable may have wrong permissions for ChromeDriver
(6 answers)
Closed 2 years ago.
Hi guys i am trying to setup chromedriver,but i am getting the following error
chrome version : 84.0.4147.105 and correspond driver dwonloaded from here
also followed the steps given here
But when i try to run my scripts it is giving me an error :
PermissionError: [Errno 13] Permission denied: 'chromedriver'
During handling of the above exception, another exception occurred:
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Also,
whereis chromedriver
chromedriver: /usr/bin/chromedriver /usr/local/bin/chromedriver
chromedriver -v
Command 'chromedriver' not found, but can be installed with:
sudo apt install chromium-chromedriver

Firstly press (ctrl + alt + T) open your Terminal.
And run this command apt-get update
Or update the Chromium Browser.

Related

trying to use selenium for firefox and running into errors

I get the following error:
File "C:\Users\ryanv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\firefox\service.py", line 44, in __init__
log_file = open(log_path, "a+") if log_path is not None and log_path != "" else None
PermissionError: [Errno 13] Permission denied: 'geckodriver.log'
when I'm trying to run
browser = webdriver.Firefox()
Could this be because firefox is in the pythonfoundation folder and I have another folder where python is?
I have tried adding geckodriver to path as well as downloading it and putting it into my other python folder however nothing works.
in your cmd line type: where python
and put the gecko file in that folder where python is located

Selenium error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist)

options = Options()
options.add_argument('use-fake-device-for-media-stream')
options.BinaryLocation = "/usr/bin/chromium-browser"
driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver",options=options)
On executing the above with sudo python3 script_name.py, the following errows shows up:
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /snap/chromium/current/command-chromium.wrapper is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
The above error doesnt show up on executing python3 script_name.py, I believe that has to do something with the display.
Please let me know how I can resolve this.
Other details:
Chromium version: 85.0.4183.83
Selenium version:3.141.0
Chrome webDriver version: 85.0.4183.83

selenium.common.exceptions.WebDriverException: Message: Service /home/user/.local/bin/chromedriver unexpectedly exited. Status code was: 1 [duplicate]

This question already has answers here:
selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/google-chrome unexpectedly exited with ChromeDriver Selenium Python on Linux
(2 answers)
WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: 127
(12 answers)
WebDriverException: Message: Service /content/chromedriver unexpectedly exited. Status code was: -6 with ChromeDriver Google Colab and Selenium
(3 answers)
WebDriverException: Message: Service /usr/bin/google-chrome unexpectedly exited. Status code was: -11 with ChromeDriver Chrome through Selenium Python
(1 answer)
Closed 2 years ago.
I am trying to use selenium and headless chrome to scrape a website so since I don't have much experience I tried to test with this simple script but I seem to be getting the error below. Do you think there are any compatibility issues with the drivers?
Code:
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--window-size=1420,1080')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
outputdir='~/zycus_report_scraper/data_engineering/scripts/python'
service_log_path = "{}/chromedriver.log".format(outputdir)
service_args = ['--verbose']
browser = webdriver.Chrome(chrome_options=chrome_options, executable_path=r'/home/user/.local/bin/chromedriver', service_args=service_args, service_log_path=service_log_path)
browser.get('https://www.twitter.com')
print(browser.page_source.encode('utf-8'))
browser.quit()
Error:
Traceback (most recent call last):
File "zycus_selenium.py", line 12, in <module>
browser = webdriver.Chrome(chrome_options=chrome_options, executable_path=r'/home/groballe/.local/bin/chromedriver', service_args=service_args, service_log_path=service_log_path)
File "/home/groballe/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
self.service.start()
File "/home/groballe/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/home/groballe/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /home/user/.local/bin/chromedriver unexpectedly exited. Status code was: 1
Driver versions:
chromedriver version: ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987#{#882})
chromium-browser version: 80.0.3987.87
selenium: selenium-3.141.0
Edit: This is on a Windows Subsystem for Linux (WSL).

What is pytesseract.pytesseract.tesseract_cmd, and How to set it up on SageMaker?

Error Says:
PermissionError: [Errno 13] Permission denied: '/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/'
when setting up pytesseract.pytesseract.tesseract_cmd from PyTesseract Module, I gave the location of where the module is installed.
What is this tesseract_cmd?
How to set it up on AWS SageMaker?
Is there any other way to extract text from images other than PyTesseract?
Why is it showing me PermissionError when I have the access?

Autokey software linux, error. I want use keyboard shorcut linux

I have the next error.
[Errno 13] Permission denied: '/home/usuario/.config/autokey/autokey.log'
in autokey program. Can you help me?