How do you go about automating/simulating (I think) an HTTP request?
March 3, 2013 7:39 PM Subscribe
I want to write a script to automate doing a search, retrieving, and parsing the search results from a website (a booking site similar to the search on www.hilton.com ).
My (extremely) rough understanding is that I should write a script to mimic the request the form is sending, and that I can use something like Firebug or Fiddler to capture what my browser is sending.
I am way out of my depths here but am pretty committed to doing this as an educational project, so I'd appreciate any direction getting started figuring out how all of this is done - I'm familiar with basic python scripting and have used urllib and BeautifulSoup to do basic web scraping, but I don't really understand how all these pieces fit together or how to get started - pointers to good resources would help tremendously, as I've found information on StackOverflow but am having trouble deciphering it. I'm a little more comfortable with what I need to do to parse the html once I get it back.
Also, am I even right in assuming that what I want to do is send a HTTP GET request? Or is this search done with Javascript (it seems like if that's the case, ths becomes more difficult? How do I tell what's really going on - I've messed around with Fiddler but am having trouble). Please bear in mind that I barely understand the words that I'm using, but I'd really like to learn. Thanks!
posted by hot soup to computers & internet (5 answers total) 5 users marked this as a favorite
To answer some of your other questions though, what I'd suggest is playing around with some Web Inspector tutorials (or Firebug tutorials or Tamper Data tutorials) until you understand the mechanics of the HTTP request.
posted by Monsieur Caution at 7:47 PM on March 3