Cannot use selenium web driver because phantomjs is not in path
Hi! I'm trying to use selenium on my code but i cannot because
phantomjs is not in path.
Here is my log:
/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/phantomjs/webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless ' Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "/usr/lib/python3.8/subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'phantomjs' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "animeflv.py", line 257, in <module> print(json.dumps(get_anime_data('https://www3.animeflv.net/anime/majutsushi-orphen-hagure-tabi-kimluckhen'), indent=4)) File "animeflv.py", line 154, in get_anime_data driver = webdriver.PhantomJS() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 56, in __init__ self.service.start() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH.
Basically, phantomjs is not in path. How can I fix it?
did you install it?
pip install PACKAGE
if that doesn't work, then it's probably not available in repl.it
can I see your code to see what's the problem?