Issue
I'm using Visual Studio code on git hub and I keep getting the same error mentioned in the title this is the code I have:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import StaleElementReferenceException
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
import multiprocessing
import time
import csv
#/////////////////////////////////////////////////////////////////// Imports
website = 'https://stockanalysis.com/stocks/'
path = r'/workspaces/web_Scrape/Stock project/Drivers/chromedriver.exe'
options = Options()
driver = webdriver.Chrome(service=Service(path), options=options)
driver.get(website)
this works fine on my home windows machine and the program runs as intended but I cant figure out what's causing the issue here. I have had a look at other people asking the same question but the solutions offered have not worked.
PermissionError: [Errno 13] Permission denied: '/workspaces/web_Scrape/Stock project/chromedriver.exe'
Solution
Hey everyone i have found the answer and fixed the code by using the following:
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(options=options)
driver.get(website)
Thank you for all the help.
Answered By - Morddekaiser
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.