如何使用robobrowser登录facebook?

时间:2015-05-25 01:08:38

标签: python facebook robobrowser

这是我的代码:

from robobrowser import RoboBrowser

browser = RoboBrowser(user_agent='Mozilla/5.0 (Windows; U; Windows NT 1;\en-    US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6')
browser.open('https://www.facebook.com/')
# Get the signup form
form = browser.get_form(id='login_form')
form['email'].value = 'my_user'
form['pass'].value = 'my_pass'
browser.submit_form(form)

我的错误:

  

requests.exceptions.ConnectionError :('Connection aborted。',ResponseNotReady('Request-sent',))

1 个答案:

答案 0 :(得分:1)

嗯,这很有效:

GetNumCols()