I'm trying to use a combination of Python, PyQuery and Paste to submit a javacript from in a web page.
I know a bit of Python, but I'm really new to javascript.
What I tried was the following:
from pyquery import PyQuery as pq
import urllib
d = pq(url='http://www.optimustag.pt/'
f = d("#login-form")
f.attr["login-user"] = "somename"
f.attr["login-pass"] = "somepass"
But I stop here, I can't find anyway of submitting this form.
If I do a: print f
, I get:
<form id="login-form" action="javascript:doLogin();">
<input id="login-user" type="text" style="border: 0px solid #fff;width:120px; 								height:20px; font-family:Arial;font-size:14px; 								position:absolute;top:43px;left:17px;" value=""/><input id="login-pass" type="password" style="border: 0px solid #fff;width:120px; 								height:20px; font-family:Arial;font-size:14px; 								position:absolute; top:43px; left:154px;" value=""/><input id="login-remember" type="checkbox" style="position:absolute;top:73px;left:20px; 								border: 0px solid #fff;"/><a href="javascript:Registration.recover();" style="position:absolute;top: 75px; left: 151px; 							font-family:Arial;font-size:11px;font-decoration:underline; 							color:#000;width:80px; height:15px;"/>
<input type="image" value="" id="login_enter_submit" src="css/blank.gif"/></form>
This is my form.
Of course that if there is some way to do this in Python without PyQuery it would be ok as well.