How to Retrieve Data from an HTTPS://URL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harlin Seritt

    #1

    How to Retrieve Data from an HTTPS://URL

    I am trying to pull data from a web page at https://localhost/wps.
    While this would work if the url was http://localhost/wps, it doesn't
    work with 'https.'

    I can do this:

    import urllib
    data = urllib.urlopen( 'http://localhost/wps').read()

    But not with https. How can I pull data from a https url?

    thanks,

    Harlin

  • Peter Hansen

    #2
    Re: How to Retrieve Data from an HTTPS://URL

    Harlin Seritt wrote:[color=blue]
    > I am trying to pull data from a web page at https://localhost/wps.
    > While this would work if the url was http://localhost/wps, it doesn't
    > work with 'https.'
    >
    > I can do this:
    >
    > import urllib
    > data = urllib.urlopen( 'http://localhost/wps').read()
    >
    > But not with https. How can I pull data from a https url?[/color]

    Does the site you are trying also require a password? Is it a public
    site and if so what is it?

    What platform are you using? What version of Python and OS?

    Think also if you're missing other potentially critical details that
    will help us out, and please fill them in.

    -Peter

    Comment

    • Fuzzyman

      #3
      Re: How to Retrieve Data from an HTTPS://URL

      It certainly *should* work - have you tried with urllib2 ? I assume the
      page works when fetched with a browser ?

      You don't have any proxy settings do you (Python can pick up on these
      automatically) ?

      What error are you getting (or what value in data) ?

      All the best,

      Fuzzyman
      http://www.voidspace.org.uk/python/index.shtml

      Comment

      • LordLaraby

        #4
        Re: How to Retrieve Data from an HTTPS://URL

        You might be using ActiveState python on Windows? If so, you most
        likely do not have the SSL layer that's required to process HTTPS
        protocol queries.
        You should install 'standard' Python from python.org to get the SSL
        handling functionality. I understand that ActiveState can not
        distribute the SSL code, for national security reasons. :-)

        LL

        Comment

        Working...