I would like to use python webbrowser to access a secure https page and save it into a file.
Am I right if I say that with webbrowser control is not possible to save an entire web page but only opening a URL? I didn't see any 'save' method.
Other than this, the page I want to use is a secure http page and I don't know how to automatically provide username and password for authentication into my script. Can you hel开发者_运维知识库p me in solving one of the 2 issues above?
Thank you very much Mn
Save means "Write a file to the disk". Of course there's no "save" method. The library opens the URL so your program can read it. Period. If your program wants to write it to disk, that's not part of reading a URL, so it's not part of browsing.
Use urllib2 for this. Not the webbrowser. It's much, much simpler.
Read Python Authentication with urllib2 for help in using urllib2.
精彩评论