-1

this is my code as of now:

from selenium import webdriver
import bs4
ask_page = input('retrieve what dial: ')
if ask_page == '':
    ask_page = 'bm056'

driver = webdriver.Firefox(executable_path=r'/home/neal/Downloads/geckodriver-v0.24.0-linux32')
soup = driver.get(f"http://www.hcrealms.com/forum/units/units_bbcode.php?id={ask_page}")
print(soup)

which returns this error:

Traceback (most recent call last):
   File "/home/user/.local/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
  File "/usr/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/home/user/Downloads/geckodriver-v0.24.0-linux32'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/PycharmProjects/heroclix_app/scraper.py", line 8, in <module>
driver = webdriver.Firefox(executable_path=r'/home/user/Downloads/geckodriver-v0.24.0-linux32')
   File "/home/user/.local/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
self.service.start()
  File "/home/user/.local/lib/python3.7/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: 'geckodriver-v0.24.0-linux32' executable may have wrong permissions. 

here is me changing the permisions and that output:

:~/Downloads$ chmod +x geckodriver
:~/Downloads$ ll geckodriver
-rwxr-xr-x 1 user user 8091065 Jan 28  2019 geckodriver*

but I'm getting the same error code.

  • Are you sure that `/home/user/Downloads/geckodriver-v0.24.0-linux32` is the proper path to the webdriver executable? It looks like the `chmod` section is for a file named `geckodriver` not `geckodriver-v0.24.0-linux32`. – Brydenr Dec 12 '19 at 17:47
  • well damn. that looks like it was the problem. but now beautiful soup and selenium don't seem to be working together right. one problem after another. Thanks so much for your help. – user12526523 Dec 12 '19 at 17:57

1 Answers1

0

Make sure that the geckodriver (or other webdriver) executable is actually executable (chmod +x path/to/geckodriver), and that the correct path is referenced in the file. Using a command like whereis geckodriver can help to find where the executable is if you are unsure.

Brydenr
  • 798
  • 1
  • 19
  • 30