minimaxir / facebook-ad-library-scraper

A Python scraper for the Facebook Ad Library, using the official Facebook Ad Library API.
MIT License
114 stars 26 forks source link

KeyError: 'data' #3

Open hmpargi opened 4 years ago

hmpargi commented 4 years ago

hi minimax,

I try to run the program, I am getting this error.

PS D:\downloads\fbscrap> python .\fb_ad_lib_scraper.py 0%| | 0/100 [00:00<?, ?it/s]Traceback (most recent call last): File ".\fb_ad_lib_scraper.py", line 49, in for ad in data['data']: KeyError: 'data' 0%|

The csv files are empty. Any Idea about this ?

minimaxir commented 4 years ago

That means no ads were retrieved, or an error was made in the configuration. I’ll add a more helpful output for that case.

Does your FB account have permission to access the API as noted in the README?

hmpargi commented 4 years ago

Yes, except the step 1, at https://www.facebook.com/ID and confirm your identity for Running Ads About Social Issues, Elections or Politics, which involves receiving a letter w/ a code at your US address and sending picture identification to Facebook.

The above step is in the process but I already created a user token https://developers.facebook.com/tools/explorer/ and configured in config.yaml.

Do you think step 1 is necessary for any to retrieve any Ad Data?

also, I left the search term: aoc as default to test.

Thanks, Hp

minimaxir commented 4 years ago

All steps are necessary.