2

I wrote a python application and it works fine on my private network. The application uses requests package and constantly fetching data from Yahoo.finance.

However when my computer is connected to my work network (either through VPN or where i am actually @work), The application is not working. Is there a way to make it work?

Asaf

  • 1
    just to clarify ... when connected to work network , there is no issue visiting yahoo.finance website from the browser ... – אסף בנימין May 28 '20 at 08:09
  • 1
    Corporate networks usually route http-traffic through proxies. I strongly assume that this is here also the case. Have you defined the proxy in the requests module? Good example from: https://stackoverflow.com/questions/8287628/proxies-with-python-requests-module `http_proxy = "http://10.10.1.10:3128" https_proxy = "https://10.10.1.11:1080" ftp_proxy = "ftp://10.10.1.10:3128" proxyDict = { "http" : http_proxy, "https" : https_proxy, "ftp" : ftp_proxy } r = requests.get(url, headers=headers, proxies=proxyDict)` – Miller-STGT May 28 '20 at 08:12
  • Is there a simple way to get proxy http address ? Or i should be get it form IT Admin (which is not possible in my case ) – אסף בנימין May 28 '20 at 08:44
  • 1
    You can check in your browser proxy settings. Usually there you have either the proxy or an URL to a proxy.pac file which contains the used proxies. – Miller-STGT May 28 '20 at 08:48
  • Thank you. I'll do that check. – אסף בנימין May 28 '20 at 08:55
  • Did you resolve the issue? – Miller-STGT May 28 '20 at 17:12

1 Answers1

0

Look into the firewall settings, or company list over blocked URLs.

It could be that your work has blocked the Yahoo.finance domain or specific applications from having outbound traffic as well.

You might also have success with privilege escalation to admin user which could grant you wider access.

Check if you can ping Yahoo.finance from a terminal or simply open it manually from a few different browsers (Edge, Chrome, Firefox etc.).

Then try to see if you from inside your Python application can fetch any URL with the request module, just to troubleshoot.

Gustav Rasmussen
  • 3,720
  • 4
  • 23
  • 53