How do I get Python's Mechanize to POST an ajax request?

This was what I came up with: req = mechanize. Request("https://site.com/path/" + url, " ") req. Add_header("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7") req.

Add_header("Referer", "https://site.com/path") cj. Add_cookie_header(req) res = mechanize. Urlopen(req) Whats interesting is the " " in the call to mechanize.

Request forces it into "POST" mode. Obviously the site didn't choke on a single space :) It needed the cookies as well. I debugged the headers using: hh = mechanize.HTTPHandler() hsh = mechanize.HTTPSHandler() hh.

Set_http_debuglevel(1) hsh. Set_http_debuglevel(1) opener = mechanize. Build_opener(hh, hsh) logger = logging.getLogger() logger.

AddHandler(logging. StreamHandler(sys. Stdout)) logger.

SetLevel(logging. NOTSET) mechanize. Install_opener(opener) Against what Firebug was showing.

– brainysmurf Nov 27 '10 at 7:29 @brainysmurf Without the space its a GET request, but by supplying a data it changes to a POST request, and a space is the smallest simplest "data" I could provide. There is nothing special about space per se. – fret Dec 30 '10 at 23:43.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions