On Sat, Oct 6, 2012 at 3:00 PM, Benjamin Fishbein <[email protected]> wrote: > > This program checks to see if a college buyback site is buying back > particular books. > > action="/BuyBack-Search.php?CSID=AQ2ZJKUWKZJBSD2T2DDMKMKB" > > When I go to the website(without using Python) and I paste the text (isbns) > into the text box then enter it, it comes back with the error: > Oops... there may be a mistake here. > > Sorry, your search could not be completed at this time. Please try again. > (Error: BB-09-00-05)
You'll need to use something like Firebug to examine the headers of the POST. CSID is based on the session. There's probably also one or more hidden fields. Consider using "mechanize": http://wwwsearch.sourceforge.net/mechanize Web scraping and automating forms is unreliable. A website isn't a documented, stable API. More importantly, scraping often violates the terms of service: http://www.textbooks.com/CustServ-Terms.php The foregoing licenses do not include any rights to: .... enable high volume, automated, electronic processes that apply to the Site or its systems; use any robot, spider, data miner, scraper or other automated means to access the Site or its systems for any purpose; .... compile, repackage, disseminate, or otherwise extract data from the Site. _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
