There must be a confusion with another thread currently on-going, called " httplib problems". I do use urllib that I find much more convenient. I suspect there could exist a javascript intervention into the document, that could modify it before the "document.location" statement, when browsing "normally". I'm going to check the full sequence of url's and inform you. Does someone know whether the server itself could raise that exception ? Regards --- Patrick Bussi patrick.bussi at space.alcatel.fr Any opinions expressed are my own and not necessarily those of my Company. "Steve Holden" <sholden at holdenweb.com> on 12/04/2001 14:57:01 Veuillez répondre à "Steve Holden" <sholden at holdenweb.com> Pour : python-list at python.org cc : (ccc : Patrick Bussi/ALCATEL-SPACE) Objet : Re: Réf. : Re: Help for urllib error : 'no host given' -------------- next part -------------- <Patrick.Bussi at space.alcatel.fr> wrote in message news:mailman.987070578.13268.python-list at python.org... > > Hi Steve, > > Thank you for your investigation. It helps me understand that my python code is > correct. I did not forget any character, while the name of the url comes from > regex extract of the page returned by the server itself. But you're right on the > fact that the name has something wrong, when used in this way. > I tested the web site "manually", that is pasting the entire name of the web > site directly into my Netscape. Same result : "Netscape can't locate the server. > No host specified" (this message translated from French) > > Therefore the question is : how does it come that a Javascript function using > 'document.location="http://blablabla"' is able to redirect my browser to the > said web site, and not 'urllib.urlopen("http://blablabla")' ? > > More, I do not understand the error message. Does it come from the server which > denies the request *or* from the dns which cannot translate the name into an > address *or* from Netscape which seems not to receive/understand the host name ? > Essentially it comes from the httplib code, which examines the URL, breaks it up into various components, and does not find a host component. This is why I wondered whether you had missed a slash out: "http/hostname" raises that exact exception. I would suggest you use urllib to read the URLs. The httplib is mostly support code for that library. regards Steve -- http://mail.python.org/mailman/listinfo/python-list
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4