Here's a quick sample i wrote to test things out:
from scrape import *Try it out with your google account. To verify you're logged in look for the Sign Out link or alternatively look for a GAUSR cookie in s.cookiejar.
s.go("http://www.google.com")
s.follow("Sign in")
x = s.doc.first('form')
params = x.get_params()
params['Email']='keithentzeroth'
params['Passwd']='xxxxxx'
s.submit(x,params)
s.go("http://www.google.com")
print s.doc
Thanks to Ka-Ping himself for clearing up some of my confusion.
My plan is to use this to test the site as if there were no script/styles enabled. Then to layer on browser behavior ( AJAX etc...), I'll look to Selenium or something of the kind.
No comments:
Post a Comment