lundi 1 mars 2021

Input data, check boxes and then collect results

I have been writing some code so I can input information into an online form and then I want to gather the results to write on an internal company website...however right now I just want to gather data and then I can write the code to input it in the company site.

Here is the code that I have so far:

import mechanize
br = mechanize.Browser()
br.open("https://www.loopnet.com/search/commercial-real-estate/for-lease/?sk=cdca5d8f06ae14ca00ac2b9e47c4afac&e=u")
br.select_form(nr=0)
br.form['States'] = 'California'
br.firm['City'] = 'San Diego, CA'
br.find_control['Office'].items[0].selected = True

What I am looking to do is:

  1. go to the site
  2. fill out the form, entering states, city
  3. Check the box next to 'office'
  4. generate results
  5. collect results

Any help would be appreciated.

Best Ben




Aucun commentaire:

Enregistrer un commentaire