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

G

Gilles Ganault

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.
 
M

Marc 'BlackJack' Rintsch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top