facebook_page_scraper icon indicating copy to clipboard operation
facebook_page_scraper copied to clipboard

AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?

Open adildg opened this issue 1 year ago • 7 comments

Hello,

When I try to import :

from facebook_page_scraper import Facebook_scraper

I get the following error :

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mpl/Desktop/FaceBookPagesScraper/facebook_page_scraper/facebook_page_scraper/__init__.py", line 1, in <module>
    from .driver_initialization import Initializer
  File "/Users/mpl/Desktop/FaceBookPagesScraper/facebook_page_scraper/facebook_page_scraper/driver_initialization.py", line 3, in <module>
    from seleniumwire import webdriver
  File "/opt/homebrew/lib/python3.10/site-packages/selenium_wire-4.3.1-py3.10.egg/seleniumwire/webdriver.py", line 13, in <module>
    from seleniumwire import backend
  File "/opt/homebrew/lib/python3.10/site-packages/selenium_wire-4.3.1-py3.10.egg/seleniumwire/backend.py", line 4, in <module>
    from seleniumwire.server import MitmProxy
  File "/opt/homebrew/lib/python3.10/site-packages/selenium_wire-4.3.1-py3.10.egg/seleniumwire/server.py", line 4, in <module>
    from seleniumwire.handler import InterceptRequestHandler
  File "/opt/homebrew/lib/python3.10/site-packages/selenium_wire-4.3.1-py3.10.egg/seleniumwire/handler.py", line 5, in <module>
    from seleniumwire import har
  File "/opt/homebrew/lib/python3.10/site-packages/selenium_wire-4.3.1-py3.10.egg/seleniumwire/har.py", line 11, in <module>
    from seleniumwire.thirdparty.mitmproxy import connections
  File "/opt/homebrew/lib/python3.10/site-packages/selenium_wire-4.3.1-py3.10.egg/seleniumwire/thirdparty/mitmproxy/connections.py", line 9, in <module>
    from seleniumwire.thirdparty.mitmproxy.net import tls, tcp
  File "/opt/homebrew/lib/python3.10/site-packages/selenium_wire-4.3.1-py3.10.egg/seleniumwire/thirdparty/mitmproxy/net/tls.py", line 43, in <module>
    "SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS),
AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?

I have tried downgrading to PyOpenSSL==22.0.0.0 didn't resolve the issue

adildg avatar Oct 16 '22 13:10 adildg

Okay, Can you share a bit of information about your environment?, I'm unaware of any such issue so I can't recreate it

shaikhsajid1111 avatar Oct 16 '22 14:10 shaikhsajid1111

Okay, Can you share a bit of information about your environment?, I'm unaware of any such issue so I can't recreate it

I am using Python 3.10.8, I have tested on Win and Mac with venv I have first tried using it by cloning the repo and also with pip3

$ git clone https://github.com/shaikhsajid1111/facebook_page_scraper
$ cd facebook_page_scraper/
$ python3 setup.py install

app.py

from facebook_page_scraper import Facebook_scraper
page_name = "metaai"
posts_count = 10
browser = "firefox"
meta_ai = Facebook_scraper(page_name, posts_count, browser, timeout=600, headless=True)

Same issue on my Mac and Windows machines

adildg avatar Oct 16 '22 16:10 adildg

Did you tried 21.0.0 as well? 🤔

shaikhsajid1111 avatar Oct 17 '22 02:10 shaikhsajid1111

Did you tried 21.0.0 as well? thinking

Thank you, it works now that I downgraded to version 21.0.0, I'm not getting the error anymore

adildg avatar Oct 17 '22 14:10 adildg

Did you tried 21.0.0 as well? 🤔

Please what do i need to downgrade??? what is the 21.0.0 here

kareemrasheed89 avatar Dec 11 '22 18:12 kareemrasheed89

Did you tried 21.0.0 as well? 🤔

Please what do i need to downgrade??? what is the 21.0.0 here

kareemrasheed89 avatar Dec 13 '22 13:12 kareemrasheed89

I have tried downgrading to PyOpenSSL==22.0.0.0 didn't resolve the issue

PyOpenSSL==21.0.0

antonioromero avatar Dec 13 '22 13:12 antonioromero