tlyu0419 / facebook_crawler

MIT License
277 stars 68 forks source link

Index Error #12

Closed ShanghaoLi0913 closed 2 years ago

ShanghaoLi0913 commented 2 years ago

IndexError Traceback (most recent call last) /opt/homebrew/lib/python3.9/site-packages/facebook_crawler.py in Crawl_PagePosts(pageurl, until_date) 27 try: ---> 28 pageid = re.findall('page_id=(.*?)"',resp.text)[0] 29 except:

IndexError: list index out of range

During handling of the above exception, another exception occurred:

IndexError Traceback (most recent call last) /var/folders/5t/0_sy0vtj6qq8t3369f_ymtrh0000gn/T/ipykernel_81480/4005812947.py in 1 import facebook_crawler 2 pageurl= 'https://www.facebook.com/MaYingjeou' ----> 3 facebook_crawler.Crawl_PagePosts(pageurl=pageurl, until_date='2016-01-01')

/opt/homebrew/lib/python3.9/site-packages/facebook_crawler.py in Crawl_PagePosts(pageurl, until_date) 28 pageid = re.findall('page_id=(.?)"',resp.text)[0] 29 except: ---> 30 pageid = re.findall('delegate_page":{"id":"(.?)"},', resp.text)[0] 31 32 # request date and break loop when reach the goal

IndexError: list index out of range

tlyu0419 commented 2 years ago

@lshowo Hi, have a look at this link. If you something wrong with this package, please change your IP to check if Facebook blocks your IP. https://github.com/TLYu0419/facebook_crawler/blob/main/sample/FansPages.ipynb

dwissaaj commented 2 years ago

Hi any update in this problem,I also got it too

it-sean-security commented 2 years ago

maybe add some settings in request-header would be better ?