The code snippet i am using ::
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:220.127.116.11) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
response = br.open('http://www.facebook.com')
br['email'] = USERNAME
br['pass'] = PASSWORD
response2 = br.submit()
for form in br.forms():
Well i tried writing out response2.read() to file to see what was happening . Only the top navigation bar has loaded . The intention of having time.sleep(50) was to provide time for page load but guess that doesnt work .
What is the right way to do this ?
Are you sure you're passing the correct login?
I've run your code with my login and it works fine for me.
The only thing I'll add is that you don't need the
time.sleep(50) in there—Mechanize blocks until it receives all the content.
Make your question more useful by giving us your complete code sample and the output (including
You shouldn't be scraping www.facebook.com.
The right way to get what you are after is to use Facebook Platform as @infrared notes.