user2320239 user2320239 - 5 months ago 6
Python Question

Open a url response in the browser

I'm writing a script that makes a post request to a url, I'd then like to open the response page in the browser of the system. I'm having trouble finding out how.

Answer

You could save the content to a local file and use webbrowser.open_new("file://yourlocalfile.html") but this has one major flaw:

Because of the browsers same origin policy this site could not load any external js, css or pictures.