UnexpectedResponse: Your request couldn't be processed
See original GitHub issueHere is my code,and error massage
I think maybe request frequently,so fb stop me a few time?
Any suggestion?
from facebook_scraper import get_posts,set_cookies
import pandas as pd
from http import cookiejar
import requests
def format_comment(c):
obj = {
"comment_id": c["comment_id"],
"comment_text": c["comment_text"],
"comment_reaction_count": c["comment_reaction_count"] or 0,
"reply_count": len(c["replies"]) if "replies" in c else 0,
"comment_time": c["comment_time"]
}
if c["comment_reactions"]:
obj.update(c["comment_reactions"])
return obj
fb_comments = []
file = 'facebook.com_cookies.txt'
cookie = cookiejar.MozillaCookieJar()
cookie.load(file)
cookies = requests.utils.dict_from_cookiejar(cookie)
set_cookies(cookies) #error message
posts = get_posts(group='atomyprobiotics', pages=2, options={"comments":True,"posts_per_page":4})
for post in posts:
#print(post['comments_full'])
if post['comments_full']:
for comment in post['comments_full']:
fb_comments.append(format_comment(comment))
for reply in comment['replies']:
fb_comments.append(format_comment(reply))
print(fb_comments)
pd.DataFrame(fb_comments).to_csv('fbcomments.csv',index=False)
UnexpectedResponse Traceback (most recent call last)
<ipython-input-13-cae0d8291e05> in <module>
21 cookie.load(file)
22 cookies = requests.utils.dict_from_cookiejar(cookie)
---> 23 set_cookies(cookies)
24
25 posts = get_posts(group='pythontw', pages=2, options={"comments":True,"posts_per_page":4})
~\Anaconda3\lib\site-packages\facebook_scraper\__init__.py in set_cookies(cookies)
48 raise exceptions.InvalidCookies(f"Missing cookies with name(s): {missing_cookies}")
49 _scraper.session.cookies.update(cookies)
---> 50 if not _scraper.is_logged_in():
51 raise exceptions.InvalidCookies(f"Cookies are not valid")
52
~\Anaconda3\lib\site-packages\facebook_scraper\facebook_scraper.py in is_logged_in(self)
979 def is_logged_in(self) -> bool:
980 try:
--> 981 self.get('https://m.facebook.com/settings')
982 return True
983 except exceptions.LoginRequired:
~\Anaconda3\lib\site-packages\facebook_scraper\facebook_scraper.py in get(self, url, **kwargs)
897 raise exceptions.NotFound(title.text)
898 elif title.text.lower() == "error":
--> 899 raise exceptions.UnexpectedResponse("Your request couldn't be processed")
900 elif title.text.lower() in temp_ban_titles:
901 raise exceptions.TemporarilyBanned(title.text)
UnexpectedResponse: Your request couldn't be processed
Issue Analytics
- State:
- Created a year ago
- Comments:13
Top Results From Across the Web
Your request couldn't be processed · Issue #849 - GitHub
Hi, I tried to log in with my account but I get the error: File ". ... UnexpectedResponse: Your request couldn't be processed....
Read more >Fix: 'Your Request Couldn't Be Processed' on Facebook - Saint
“Your Request Couldn't be Processed” on Facebook? Here's the Fix! · 1. Re-Login to Your Account. · 2. Reload the Webpage and Restart...
Read more >Your Request Couldn't be Processed. - Meta for Developers
Hi, I have problems showing the page-plugin version of the Facebook Page Plugin on my page. The error message is Your Request Couldn't...
Read more >An unexpected error occurred and your request couldn't be ...
Exception message: Failed to resolve tenant name from accepted domain 'biocertindia.info'. Call stack. Microsoft.Exchange.Data.Directory.
Read more >How to fix the 'There was an error processing your request ...
To fix it you really need to go to your facebook app-> account settings -> security and login, then under Where You're Logged...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try the latest master branch
Also experiencing this, only downloaded very recently and the issue started on my first request, so I don’t think it’s a frequency thing.