URL works in browser, refused in script

  • 1
  • Problem
  • Updated 5 years ago
I'm having a problem getting query results in a script. The URL for the query is http://api.wunderground.com/api/my_ke... (where "my_key" is my actual key).

When I paste that URL into firefox's address bar, I get the expected result. When I run a python script and try to get the string value from the exact same URL, I get an HTTP Error 403 or an HTTP Error 407.
Photo of danbridgeman

danbridgeman

  • 6 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 1
Photo of danbridgeman

danbridgeman

  • 6 Posts
  • 0 Reply Likes
Sorry, this problem was actually on my network's end. No problem with the software.
Photo of Raffi Tchoboian

Raffi Tchoboian

  • 7 Posts
  • 0 Reply Likes
Hello,
I have the same probleme with javascript, so how have you resolved this problem?
Thank you
Photo of danbridgeman

danbridgeman

  • 6 Posts
  • 0 Reply Likes
My problem was that the python script was being run on a client, and then sent back through a gateway server, and then on through to the wunderground server. When I invoke the script directly on the gateway, it runs just fine. So it's more that I've found a work-around than actually resolved anything.
Photo of Raffi Tchoboian

Raffi Tchoboian

  • 7 Posts
  • 0 Reply Likes
thank you for your answer. But now, can you get a response in your script?
Than you
Photo of danbridgeman

danbridgeman

  • 6 Posts
  • 0 Reply Likes
Actually got a little more clarification on this. The scripts do work directly on some of our client sessions, but not others. The key seems to be that whenever we run the script on a client in a VMware session, we get the 403; when the client is a real, physical PC we have no problems. And we have no problems when the script is invoked from the Gateway, which is itself a VM.

So it's something about being a client session on a virtual machine which causes our problem.