elvisyjlin / media-scraper

Scrapes all photos and videos in a web page / Instagram / Twitter / Tumblr / Reddit / pixiv / TikTok
MIT License
371 stars 49 forks source link

AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS' #26

Open kupietools opened 1 year ago

kupietools commented 1 year ago

python3 -m mediascraper.twitter Doesn't work.

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Volumes/500GB/Users/Shared/moved from ~/Downloads/media-scraper/mediascraper/twitter.py", line 12, in <module>
    scraper = mediascrapers.TwitterScraper(scroll_pause = 1.0, mode='normal', debug=False)
  File "/Volumes/500GB/Users/Shared/moved from ~/Downloads/media-scraper/mediascrapers.py", line 378, in __init__
    super().__init__(**kwargs)
  File "/Volumes/500GB/Users/Shared/moved from ~/Downloads/media-scraper/mediascrapers.py", line 38, in __init__
    self._driver = seleniumdriver.get('PhantomJS')
  File "/Volumes/500GB/Users/Shared/moved from ~/Downloads/media-scraper/util/seleniumdriver.py", line 36, in get
    driver = webdriver.PhantomJS(executable_path=source, service_log_path=join(path, 'phantomjs.log'), service_args=["--remote-debugger-port=9000", "--web-security=false"]) 
AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS'
KP9982 commented 1 year ago

PhantomJS support was removed from Selenium after 3.3.0 Install the old version

pip uninstall selenium 
pip install -U selenium==3.3.0
Giosthebest commented 2 weeks ago

PhantomJS support was removed from Selenium after 3.3.0 Install the old version

pip uninstall selenium 
pip install -U selenium==3.3.0

It still doesn't work for me. Screenshot 2024-08-03 005316 Screenshot 2024-08-03 005330