无法使用 xmpppy 库通过 Python 连接到 Facebook 聊天
我正在尝试用 python 编写一个脚本来连接到 facebook 聊天。我就是做不到。 这是代码
import xmpp
FACEBOOK_ID = "[email protected]"
PASS = "password"
jid=xmpp.protocol.JID(FACEBOOK_ID)
C=xmpp.Client(jid.getDomain(),debug=[])
if not C.connect(("chat.facebook.com",5222)):
raise IOError('Can not connect to server.')
if not C.auth(jid.getNode(),PASS):
raise IOError('Can not auth with server.')
C.send(xmpp.protocol.Message("[email protected]","Hello world from script",))
这是错误
An error occurred while looking up _xmpp-client._tcp.chat.facebook.com
之前已经问过类似的问题,但没有一个答案对我有帮助,我在网上找不到任何为我解决这个问题的答案。 任何帮助将不胜感激,因为我已经坚持了好几天了。
非常感谢您的帮助。
I am trying to write a script in python to connect to facebook chat. I am just not able to.
Here is the code
import xmpp
FACEBOOK_ID = "[email protected]"
PASS = "password"
jid=xmpp.protocol.JID(FACEBOOK_ID)
C=xmpp.Client(jid.getDomain(),debug=[])
if not C.connect(("chat.facebook.com",5222)):
raise IOError('Can not connect to server.')
if not C.auth(jid.getNode(),PASS):
raise IOError('Can not auth with server.')
C.send(xmpp.protocol.Message("[email protected]","Hello world from script",))
And this is the error
An error occurred while looking up _xmpp-client._tcp.chat.facebook.com
A similar question has been asked before but None of the answers have helped me and I can't find any answer online that has solved this for me.
Any help would be really appreciated coz I am really stuck at this for days now.
Thanks a lot for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论