0

I'm using the requests module for url fetching under linux (minibian) via ethernet on a raspberry pi 1.

To fetch the data i use a loop over a list of urls:

for url in urllist:
   response = requests.get(url,timeout=5) 

I get randomly the error: "[Errno 101] Network is unreachable requests". Befor i tested the urrlib modul with "urllopen" and the same error. The confusing is the script runs under Windows 10 without any error.

So is there a linux network configuration problem?

Thanks in advance!

kyi
  • 43
  • 1
  • 10
  • Are you sure you get the errors randomly? My idea is that there's an url in that list that is blocked by a firewall on your linux machine. – Irmen de Jong Aug 31 '16 at 17:59
  • How can i proof if a firewall is running? I disabled the ufw-firewall. I fetch from the same url, but different data ( yahoo finance api). Could there maybe be a problem with dns or something else? – kyi Aug 31 '16 at 18:11
  • This really sounds like some sort of basic networking problem. – larsks Aug 31 '16 at 19:06
  • maybe you can get some more insight by turning on logging, see http://stackoverflow.com/questions/16337511/log-all-requests-from-the-python-requests-module or http://docs.python-requests.org/en/v0.10.6/user/advanced/#verbose-logging – Irmen de Jong Aug 31 '16 at 20:36

0 Answers0