lundi 27 mai 2019

Selecting a subform from form in Mechanize/Python

I want to fill username and password at https://myapps.lilly.com with usage of Mechanize lib. I have discovered that there is only one form 'e1' at this page. Inside of it is the 'username' I want to fill in.

I checked it on using multiple browser settings - no effect at all. I inspected the page. Then I realized that I have to access table's cell name=username, however I cannot find info about filling/clicking particullar tables in lib's documentation. Below you may find a snip that I used to check list of forms at page.

import mechanize

br = mechanize.Browser()
br.addheaders = [('User-agent', 'Mozilla/5.0')] 
br.open('https://myapps.lilly.com')

for form in br.forms():
    print(form.name)

I want to be able to log in to this page using python.




Aucun commentaire:

Enregistrer un commentaire