[Python] Main Shop AB - Send Haggle POST Data?
For the past few days I've been writing a MSAB, and it's nearly done. (OCR, formatting haggle, getting to haggle page, all done.) But when I try to actually send the POST data on the haggle page, it just stays on the haggle page. An example of my code:
The first link is just OCR and the price. The variable "link" is where I think I'm doing something wrong. (Setting the referrer) Note that link is scraped from the mainshop page when the item restocks, and it isn't always that. The resulting page source ("buying") doesn't even say that I failed to click the pet correctly, or that my haggle was rejected, it is equivalent to a refresh of the page.
- Rep Power
It appears from the code I see you are trying to use a GET request, not a POST request.
urllib2 works in this way: if there is no data parameter, send it as a GET request. If there is a data parameter, sent a POST request. I'd also make sure you're setting the user-agent in the headers to FF or something, since the default user-agent is Python-Urllib (or something similiar), which is obviously not a browser.
The Following User Says Thank You to Miguel For This Useful Post:
Don't worry, the headers are set to FF, and thanks, I'll try adding in the data.
Originally Posted by ./m
---------- Post added at 06:26 PM ---------- Previous post was at 06:10 PM ----------
That worked! Thanks a ton!