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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gilles Ganault

    #1

    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=s earch"

    [...]

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

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

    Any idea why it does this?

    Thank you.
  • Marc 'BlackJack' Rintsch

    #2
    Re: URL as input -> "IOErro r: [Errno 2] The system cannot find thepath specified"

    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=s earch"
    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\\sea rch\\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

    Comment

    • Gilles Ganault

      #3
      Re: URL as input -> "IOErro r: [Errno 2] The system cannot find the path specified"

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

      Comment

      Working...