Are cookies kept in a Mechanize browser between opening URLs?
问题 I have code similar to this: br = mechanize.Browser() br.open("https://mysite.com/") br.select_form(nr=0) #do stuff here response = br.submit() html = response.read() #now that i have the login cookie i can do this... br.open("https://mysite.com/") html = response.read() However, my script is responding like it's not logged in for the second request. I checked the first request and yes, it logs in successfully. My question is: do cookies in Mechanize browsers need to be managed or do I need