1

I'm trying to web scrape reviews from (https://boxes.mysubscriptionaddiction.com/box/boxycharm?ratings=true#review-update-create) but when I run the code:

from selenium import webdriver
chrome_path = r"C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\Scripts"
driver = webdriver.Chrome(chrome_path)

driver.get("https://boxes.mysubscriptionaddiction.com/box/boxycharm?ratings=true#review-update-create")
review = driver.find_element_by_class_name("comment-body")
for post in review:
    print(post.text)

I got the following error(s). What do I need to do to fix this?

"C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\python.exe" "C:/Users/Sara Jitkresorn/PycharmProjects/untitled/venv/SubsAddict.py"
Traceback (most recent call last):
  File "C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
  File "C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 756, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1155, in _execute_child
    startupinfo)
PermissionError: [WinError 5] Access is denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Sara Jitkresorn/PycharmProjects/untitled/venv/SubsAddict.py", line 3, in <module>
    driver = webdriver.Chrome(chrome_path)
  File "C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\lib\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: 'Scripts' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Gino Mempin
  • 25,369
  • 29
  • 96
  • 135

1 Answers1

2
  1. You should replace all "\" with "/".
  2. Your chrome path is wrong, you need to find path to chrome executable, it should be stored in Program Files or Program Files x86 Google subfolder.
  • Yea I just noticed. I've replaced the 2nd and 3rd line with `driver = webdriver.Chrome(executable_path=r'C:\Users\Sara Jitkresorn\AppData\Local\Programs\Python\Python37\Scripts\chromedriver\\chromedriver.exe')` – Sara Jitkresorn Mar 08 '20 at 11:24