471,891 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,891 software developers and data experts.

URL as input -> "IOError: [Errno 2] The system cannot find the path specified"

Hello

I'm trying to use urllib to download web pages with the GET method,
but Python 2.5.1 on Windows turns the URL into something funny:

========
url = "amazon.fr/search/index.php?url=search"

[...]

IOError: [Errno 2] The system cannot find the path specified:
'amazon.fr\\search\\index.php?url=search'

f = urllib.urlopen(url)
========

Any idea why it does this?

Thank you.
Oct 24 '08 #1
2 3004
On Fri, 24 Oct 2008 19:56:04 +0200, Gilles Ganault wrote:
I'm trying to use urllib to download web pages with the GET method, but
Python 2.5.1 on Windows turns the URL into something funny:

========
url = "amazon.fr/search/index.php?url=search"
This "URL" lacks the protocol! Correct would be http://amazon.fr… (I
guess).
[...]

IOError: [Errno 2] The system cannot find the path specified:
'amazon.fr\\search\\index.php?url=search'
Without protocol it seems that the 'file://' protocol is used and there
is no such file on your system.

Ciao,
Marc 'BlackJack' Rintsch
Oct 24 '08 #2
On 24 Oct 2008 18:02:45 GMT, Marc 'BlackJack' Rintsch <bj****@gmx.net>
wrote:
>This "URL" lacks the protocol! Correct would be http://amazon.fr (I
guess).
Thanks, that did it :)
Oct 24 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post: by
reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.