Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic insertion of user name and password.

Status
Not open for further replies.

atfqn

Technical User
May 31, 2005
1
US
I am trying to find a way to use python to insert a username and password into a couple of web sites. One is encoded in html and the other in php. All it has to do is insert the data into two fields and force a button to submit. The data is not dynamic and can be coded into the program.

Up to now I have been running a macro on my 2k3 ent box. Now I wish to do it in linux as I am playing with smoothwall.

I have checked google as well as posted elsewhere with no response/answers that worked. I am new to programming in python but I have spent alot of time with c++.

Thanks guys.
 
Perhaps you could use pyexpect ?


"If you always do what you've always done, you will always be where you've always been."
 
i do a similar thing, but manually.
since you're using linux, you likely have /usr/bin/expect avalable.

s="""
#!/usr/bin/expect
spawn telnet myServer
expect "Password:"
send "myPassword\r"
expect eof
"""

h=open("tmp.exp")
h.write(s)
h.close()
os.popen("chmod +x tmp.exp; tmp.exp")

##this code hasn't been subjected to QA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top