Tuesday, 15 July 2014

python - urllib does not handle # character properly -


I have my URLs that look like:

  http: // Me: When I run urlparse on this url, it returns only  me: me1234 # @ localhost: 8080  instead of returning netlocpath  

Strong> me: me1234 . Six. Mows. Rib Import Pars o = Pars. Rulpers ('http: // me: me1234 # localhost: 8080 /') Parsersalt (scheme = 'http', netlok = 'M 1234', path = '', params = '', query = '', fragment = '@ localhost: print o

8080 /')

< P> Any ideas why parsing fail? I think this is a pretty standard URL.

This is one. You can convert it to first encoding:

  to six.movs.Relib import pars o = purse.Ralparse ('http: // me: me1234% 23 @ localhost: 8080 /') print O  

This should work for your needs.


No comments:

Post a Comment