On Thu, Dec 17, 2009 at 8:33 AM, Shrinivasan T <[email protected]>wrote:
> Hi, > > I am trying to scrap the website 'http://service.ringcentral.com' > > It has a form with three input boxes. > > When trying to get the form with mechanize, it is throwing the > following error. > > mechanize._mechanize.FormNotFoundError: no form matching name 'login' > > but, the page has the form with name "login". > > This form is submitted by javascript. > > To make it simple,You can find the actual posted url using LiveHttp headers(I think /login/main.asp in your case ). Then use urllib,urllib2 with POST parameters, values = {'LoginName' : 'AAA', 'PIN' : 'BBB, 'Password' : 'CCC' } data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) the_page = response.read() The reponse page contains," Login Error" with description """ Error: Session cannot be established. Enable per-session cookies in your browser's security settings and login again. """ Which means handling cookies should make it work. :) -- Regards, S.Selvam _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
