Am starting my homework on urllib2
my first page which is a HTML has a username and password field and a login button
am able to successfully login
this goes into a JAVAscript page which contains a link update
when i added urlopen(form.cl ick("update")). read()
It threw me an error stating that
My motive is to click the link on the page how do i have to do it ?
my first page which is a HTML has a username and password field and a login button
Code:
from urllib2 import urlopen
from ClientForm import ParseResponse
response = urlopen("http://172.16.0.200:8080/mypage.html")
forms = ParseResponse(response, backwards_compat=False)
print forms
form = forms[0]
print form
original_text = form["userId"]
form["userId"] = "XXX"
original_text = form["password"]
form["password"] = "YYY"
print urlopen(form.click()).read()
this goes into a JAVAscript page which contains a link update
Code:
<a class=welcome href="javascript:login('up');">update</a> |
It threw me an error stating that
Code:
ClientForm.ControlNotFoundError: no control matching name 'update', kind 'clickable'