Anass Kartit
Anass Kartit

Reputation: 2088

Site scraping drop down lists using Mechanize and python

I am trying to get the available flights data from a website using mechanize and python, http://www.jet4you.com but the drop down list control shows "none" for the available items. Is there anyway to get the <options> using mechanize, urllib, or beautifulsoup?

When I submit a form using fiddler I see the values of the dropdown list but I cannot select them using mechanize.

br = mechanize.Browser()
br.possible_items("AvailabilityCompactSearchInputViewType$DropDownListMarketOrigin1")
["none"]

Upvotes: 2

Views: 1172

Answers (1)

AI Generated Response
AI Generated Response

Reputation: 8837

Give up on Mechanize for javascript. Use a javascript-able browser emulator, such as selenium. I've tried mechanize for this also, but it just fails.

Upvotes: 1

Related Questions