Skip to content

Commit

Permalink
Don't try hit /posts/ (it usually 404s)
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-ninja committed Jul 28, 2022
1 parent ba26b7b commit 089688d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions facebook_scraper/page_iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ def iter_hashtag_pages(hashtag: str, request_fn: RequestFunction, **kwargs) -> I
def iter_pages(account: str, request_fn: RequestFunction, **kwargs) -> Iterator[Page]:
start_url = kwargs.pop("start_url", None)
if not start_url:
start_url = utils.urljoin(FB_MOBILE_BASE_URL, f'/{account}/posts/')
try:
request_fn(start_url)
except Exception as ex:
logger.error(ex)
start_url = utils.urljoin(FB_MOBILE_BASE_URL, f'/{account}/')
start_url = utils.urljoin(FB_MOBILE_BASE_URL, f'/{account}/')
return generic_iter_pages(start_url, PageParser, request_fn, **kwargs)


Expand Down

0 comments on commit 089688d

Please sign in to comment.