shaikhsajid1111 / facebook_page_scraper

Scrapes facebook's pages front end with no limitations & provides a feature to turn data into structured JSON or CSV
https://pypi.org/project/facebook-page-scraper/
MIT License
236 stars 66 forks source link

I cant run the code #74

Open dgomp opened 1 year ago

dgomp commented 1 year ago

Hello, I'm trying to run the system, but it's giving several errors. Here is the code used:

`from facebook_page_scraper import Facebook_scraper

page_name = "nameofpage" posts_count = 10 browser = "firefox" timeout = 60 #Seconds headless = True meta_ai = Facebook_scraper(page_name, posts_count, browser, timeout=timeout, headless=headless)

call the scrap_to_json() method

json_data = scraped_data.scrap_to_json()

filename = "data_file" directory = "./" meta_ai.scrap_to_csv(filename, directory)`

Now, the errors occurred:

Traceback (most recent call last): File "C:\Users\Diego\OneDrive\Documentos\VS\DP\main.py", line 1, in from facebook_page_scraper import Facebook_scraper File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\facebook_page_scraper__init__.py", line 1, in from .driver_initialization import Initializer File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\facebook_page_scraper\driver_initialization.py", line 3, in
from seleniumwire import webdriver File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\webdriver.py", line 13, in from seleniumwire import backend File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\backend.py", line 4, in from seleniumwire.server import MitmProxy File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\server.py", line 4, in from seleniumwire.handler import InterceptRequestHandler File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\handler.py", line 5, in from seleniumwire import har File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\har.py", line 11, in from seleniumwire.thirdparty.mitmproxy import connections File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\thirdparty\mitmproxy\connections.py", line 9, in from seleniumwire.thirdparty.mitmproxy.net import tls, tcp File "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\thirdparty\mitmproxy\net\tls.py", line 43, in
"SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS), AttributeError: module 'OpenSSL.SSL' has no attribute 'SSLv2_METHOD'. Did you mean: 'SSLv23_METHOD'?

My objective was to post the posts of a certain page, in order to verify if there would be a certain mention in one of the posts. Does anyone know how to proceed? :/

mystvictor commented 1 year ago

Hi, Update selenium wire to version 5.1.0, this issue has been addressed. You can either uninstall the current version and re-install it (pip uninstall selenium-wire / pip install selenium-wire)

Yusef63 commented 7 months ago

مرحبا, أنا أحاول تشغيل النظام ، لكنه يعطي عدة أخطاء. هنا هو رمز يستخدم:

`من facebook_page_scraper استيراد Facebook_scraper

page_name = "nameofpage" posts_count = 10 المتصفح = "فايرفوكس" مهلة = 60 #ثوان مقطوعة الرأس = True meta_ai = Facebook_scraper(page_name, posts_count, المتصفح, timeout=مهلة مقطوعة الرأس=مقطوعة الرأس)

استدعاء scrap_to_json (طريقة) #json_data = scraped_data.scrap_to_json()

filename = "data_file" الدليل = "./" meta_ai.scrap_to_csv(filename, دليل)`

الآن أخطاء وقعت:

Traceback (most recent call last): File "C:\Users\Diego\OneDrive\Documentos\VS\DP\main.py" خط 1 من facebook_page_scraper استيراد Facebook_scraper الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\facebook_page_scraperinit.py" ، خط 1 من .driver_initialization استيراد مهيئ الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\facebook_page_scraper\driver_initialization.py"السطر 3 من seleniumwire استيراد webdriver الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\webdriver.py" السطر 13 ، من seleniumwire استيراد الخلفية الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\backend.py" خط 4 في من seleniumwire.خادم استيراد MitmProxy الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\server.py" خط 4 في من seleniumwire.معالج استيراد InterceptRequestHandler الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\handler.py" السطر 5 ، من seleniumwire استيراد هار الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\har.py" السطر 11 من seleniumwire.مرشحين.mitmproxy استيراد اتصالات الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\thirdparty\mitmproxy\connections.py"السطر 9 في من seleniumwire.thirdparty.mitmproxy.net استيراد tls, tcp الملف "C:\Users\Diego\AppData\Local\Programs\Python\Python310\lib\site-packages\seleniumwire\thirdparty\mitmproxy\net\tls.py"الخط 43 في "SSLv2": (SSL.SSLv2_METHOD, BASIC_OPTIONS), AttributeError: وحدة 'بينسل.SSL' لا السمة 'SSLv2_METHOD'. هل تقصد: 'SSLv23_METHOD'?

كان هدفي من نشر المشاركات من صفحة معينة ، من أجل التحقق من إذا كان سيكون هناك بعض من ذكر في إحدى الوظائف. لا أحد يعرف كيفية المضي قدما ؟ :/

Screenshot_٢٠٢٤٠٤١٥-١٦٤٧٥٧ Please help me how to redeem the code