Skip to content

Commit

Permalink
When POSTing params, don't keep including the params on future requests
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-ninja committed Jun 30, 2022
1 parent ea3178f commit c0a01e6
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions facebook_scraper/extractors.py
Original file line number Diff line number Diff line change
@@ -1329,6 +1329,8 @@ def full_post_html(self):
url = self.post.get('post_url').replace(FB_BASE_URL, FB_MOBILE_BASE_URL)
logger.debug(f"Fetching {url}")
response = self.request(url)
if response.text.startswith("for (;;)"):
logger.warning("full_post_html startswith for (;;)")
self._full_post_html = response.html
return self._full_post_html
else:
4 changes: 1 addition & 3 deletions facebook_scraper/facebook_scraper.py
Original file line number Diff line number Diff line change
@@ -835,9 +835,7 @@ def get(self, url, **kwargs):

if kwargs.get("post"):
kwargs.pop("post")
if kwargs.get("params"):
self.requests_kwargs["params"].update(kwargs.pop("params"))
response = self.session.post(url=url, **self.requests_kwargs, **kwargs)
response = self.session.post(url=url, **kwargs)
else:
response = self.session.get(url=url, **self.requests_kwargs, **kwargs)
DEBUG = False

0 comments on commit c0a01e6

Please sign in to comment.