Finding Dynamic text value of static field using mechanize browser python

190 Views Asked by At

How can I find the Dynamic text that is as per the user details entered of the static field result using mechanize browser in python. I can do it using "split" function as splitting the text and storing the text in a variable. But is there any function that will directly give me results as: Name: abc Addr: pqr Gender: male

abc=mechanize.Browser()
abc.set_handle_robots(False)
abc.open(url)
abc._factory.is_html = True
abc.select_form(nr=0)
x=abc.submit()
m=x.read()

I tried using 'findAll' but not working well. Here abc can be any name as per the login. Data are not of any text box input values. Any help will be appreciated.

1

There are 1 best solutions below

1
On

this should tell you the field names:

for f in br.forms()
print f.name

fill in the blanks:

form["field1"] = ["input1"]

hope this is what you were asking for. cheers!