2

Hello I want try load website with PhantomJS

from selenium import webdriver
driver = webdriver.PhantomJS(executable_path="/Users/martinzuffa/phantomjs-2.5.0-beta-macos/bin/phantomjs")
driver.get("www.google.com")
print(driver.page_source)

Here is the error

Traceback (most recent call last): File "/Users/martinzuffa/PycharmProjects/pythonProject/main.py", line 8, in driver = webdriver.PhantomJS(executable_path="/Users/martinzuffa/phantomjs-2.5.0-beta-macos/bin/phantomjs") File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 52, in init self.service.start() File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 96, in start self.assert_process_still_running() File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 107, in assert_process_still_running raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: Service /Users/martinzuffa/phantomjs-2.5.0-beta-macos/bin/phantomjs unexpectedly exited. Status code was: -9

1 Answer 1

1

PhantomJS was deprecated in Selenium 3.8.1

* PhantomJS is now deprecated, please use either Chrome or Firefox in headless mode

Additionally, Selenium 4.1.0 packages doesn't contain the PhantomJS module anymore:

PythonModules


Solution

As an alternative you have to use either of the following:

Sign up to request clarification or add additional context in comments.

1 Comment

Hi, Can Firefox or Chrome use authenticated proxy in selenium headless mode?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.