How can I check checkbox if HTML code looks like:
<input type="checkbox" name="tos_understood" style="background:none; border:none" />
So, my python code is:
import urllib
import urllib2
import cookielib
authentication_url = 'http://test.com'
# Input parameters we are going to send
payload = {
'user': 'newuser',
'pass': '12345'
'tos_understood': ??????????
}
# Use urllib to encode the payload
data = urllib.urlencode(payload)
# Build our Request object
req = urllib2.Request(authentication_url, data)
print req
# Make the request and read the response
resp = urllib2.urlopen(req)
contents = resp.read()
print contents
What should I write in tos_understood section? There is no way to login without checked checkbox.
This should work:
did you try something like :
or
I looked around for an answer to this but couldnt really find much
If those dont work maybe try something like selenium that actually drives a browser with a window it is waaaayyy easier and you can also run it headless so that the window doesn't pop up