dfreelon / fb_scrape_public

Scrapes posts and comments from public Facebook pages.
BSD 3-Clause "New" or "Revised" License
106 stars 52 forks source link

urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] #7

Closed Altroo closed 6 years ago

Altroo commented 6 years ago

Hello i've tested this today and i'm getting this error :

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)

During handling of the above exception, another exception occurred:

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>

dfreelon commented 6 years ago

Just tested it myself and it works on my end. Please provide the code you used, thanks.

Altroo commented 6 years ago
import fb_scrape_public as fsp
#added my both secret ids + Page id
my_posts = fsp.scrape_fb("ID1", "ID2", ids="PAGEID")

works on windows but not on mac.

dfreelon commented 6 years ago

Interesting... let me run some tests and get back to you.

Altroo commented 6 years ago

The worked version on windows creates csv file but the content is a messy characters as you can see :

capture d ecran 2018-02-05 a 14 54 23

dfreelon commented 6 years ago

The weird characters are Excel's fault; try looking at it in a plain text editor. As for the messed up delimiters, you're probably using Euro-style CSV with semicolon delimiters. The best way to fix that is probably to dump the Python var holding the data to file yourself using the standard CSV file writing functions configured for Euro-style CSVs.

dfreelon commented 6 years ago

As for your Mac problem, can you confirm you are using the exact same Python version on both Windows and Mac?

Altroo commented 6 years ago

Yeah same version 3.6, i've used a basic scrap with beautifulsoup to get some data from wikipedia and same thing SSL: CERTIFICATE_VERIFY_FAILED, but when i run it to get data from a local server it works.

dfreelon commented 6 years ago

Well at least that confirms your original issue isn't specific to FSP, so I am gonna close this.