tryolabs/requestium

PhantomJS critical error with Selenium v4

vladiscripts opened this issue · 10 comments

In Selenium Webdriver v4 (released on 13 Oct 2021) removed support of PhantomJS.
https://github.com/SeleniumHQ/selenium/blob/5b5f3f4c841c3a8fe58d40044ed61231c082ff84/py/CHANGES

So, the error raising:

  File "C:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\requestium\__init__.py", line 1, in <module>
    from .requestium import Session
  File "C:\Users\username\AppData\Local\Programs\Python\Python38\lib\site-packages\requestium\requestium.py", line 404, in <module>
    class RequestiumPhantomJS(DriverMixin, webdriver.PhantomJS):
AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS'

The solution might be to remove PhantomJS from the code.
Or a version limitation in the setup.py repository, or in a local project in requirements.txt:

selenium>=3.7.0,<4.0.0

@joaqo are you planning on doing any further maintenance on this package? If not, would you consider handing over ownership so some of these critical fixes can be addressed?

joaqo commented

Hi @lordjabez thank you for your interest in Requestium! Let me get back to you after the holidays (mid January) with an answer to this question.

@joaqo just circling back on the above...

joaqo commented

Hi @lordjabez ! We went through this internally, and if you're still interested we can give you the necessary permissions to maintain the repo.

@joaqo I am definitely still interested, thanks!

joaqo commented

Added you as maintainer! Thank you for the interest, please don't hesitate to ask if you need to discuss anything regarding the future of the project.

think phantomjs should be removed

PhantomJS is pretty much dead now.
It's a old headless browser that no real user have ever used and was solo created for developers to automate & scrape stuff.
it don't get any more updates and are now archived/suspended for a long time now

ppl should just stop using it and switch to something like puppeteer instead.

Does PhantomJS work at all? I tried recently to run it not via Requestium/Selenium, but on its instruction. But requests to sites did not return pages.
It is necessary to remove support through Selenium.
If this does not work directly, then sould be remove the support entirely.

If it worked directly, you could try to leave it by adding support for direct launch.
Still, the small size of the PhantomJS driver makes it easy to install on a VPS and would be suitable for cases with scraping simple JS pages.
Than install Chrome/Selenium/chromedriver there, and monitor the relevance and synchronization of their versions, waste time on Chrome's problem with the confusion of installing from the repository and via snap.

Fixed in #53