The html code of the form, and my code are below. I can't get the value to post/submit. Can anyone help?
HTML Code of Form:
<form method='post' autocomplete='off'>
<input type='hidden' name='action' value='grant-revoke' />
<input type='hidden' name='creator_badge_index' value='1' />
<input type='hidden' name='token' value='92dcd92a8bc16f73f330d118ae1ed891' />
<input type='hidden' name='do-grant' value='1' />
<div id='grant-div'><span class='label'>Grant badge: </span><input type='text' id='grant-userid' name='grant-userid' value='userid / avatar name' /><input type='submit' value='Grant!' /></div>
</form>
My Code:
opener = urllib.request.build_opener()
cj = http.cookiejar.MozillaCookieJar()
cj.load('C:/Users/xx/Documents/moz_cookies.txt')
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
params = urllib.parse.urlencode({'grant-userid' : 'Guest_xLolKittyx'})
form = opener.open('http://www.imvu.com/catalog/web_manage_badges.php?action=grant-revoke&creator_badge_index=1', params)
data = form.read()
form.close()
print(data)