0

I am trying to make a script that auto fills the HTML5 form values (Name and Password). I don't know how to insert the values.

On other sites I can't find a good explanation about how to do it.

Login site: https://ncod22.n-able.com/

username = TestName
password = TestPwd
(These aren't working)

Pyton code (so far):

import webbrowser, sys
webbrowser.open('https://ncod22.n-able.com/')
1

1 Answer 1

2

Try mechanize:

import mechanize
url="https://ncod22.n-able.com/"
pg=mechanize.Browser()
pg.set_handle_robots(False)
r=pg.open(url)   #open page
pg.select_form(nr=0)   #select form number
pg.form["username"]="TestName"   #<input> name
pg.form["password"]="TestPwd"   #<input name="password">
pg.method="POST"   #form method
r=pg.submit()   #submitting form
#print(r.read())    to see Page source
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.