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
试试mechanize:
相关问题 更多 >
编程相关推荐