The form-based login for a webpage can often by bypassed with the following URL structure:
https://myusername:[email protected]
(note: I know there are security concerns here; that is beyond the scope of this question).
urllib2
doesn't like this:
urllib2.urlopen('http://myusername:[email protected]')
InvalidURL: nonnumeric port: '[email protected]'
I guess it is seeing the second as the start of the URL. I know that the requests
library has no such problems. But for legacy reasons, I am stuck with using urllib2
. Is it possible to get around this with urllib2
?