Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find any ServerJSDefine. Please report this, along with the data below #655

Open
Adamszsz opened this issue Nov 21, 2021 · 1 comment

Comments

@Adamszsz
Copy link

Adamszsz commented Nov 21, 2021

import fbchat

# Log the user in
session = fbchat.Session.login("xxx", "xxx")

print("Own id: {}".format(session.user.id))

# Send a message to yourself
session.user.send_text("Hi me!")

# Log the user out
session.logout()

And i have this error :
Traceback (most recent call last):
File "C:\Scrapers\PowiadomienieStockNewOrderMessenger.py", line 4, in
session = fbchat.Session.login("xxx", "xxx")
File "C:\Python39\lib\site-packages\fbchat_session.py", line 362, in login
return cls._from_session(session=session)
File "C:\Python39\lib\site-packages\fbchat_session.py", line 419, in _from_session
define = parse_server_js_define(r.content.decode("utf-8"))
File "C:\Python39\lib\site-packages\fbchat_session.py", line 36, in parse_server_js_define
raise _exception.ParseError("Could not find any ServerJSDefine", data=html)
fbchat.ParseError: Could not find any ServerJSDefine. Please report this, along with the data below!

How can i do to work with that?
Also how can i get user ID to send message? Because above code will send message to my only .

@MohamadOday
Copy link

Hi!,
I would suggest you to try a very old user-agent tha may fix all html/json issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants