I am trying to get data from an website and I am with an issue that I can't pass trough an array.
I need to run requests.get(value[0]), requests.get(value[1]), requests.get(value[N]).
But when I got an error this loop just STOP.
The code:
import requests
value = ['http://teste', 'http://cast4.audiostream.com.br:8651/status-json.xsl']
try:
for item in value:
response = requests.get(item)
print(response)
except:
print('response')
And those two URLs are a real case, if I run this script will explode an exception, but the second URL is a valid URL, I've tried some other options using while, putting pass instead of print() but without success, how can I handle that to let my loop for, keep doing its job??
Thanks!!!
try...exceptclauses in the loop, instead of around it. But your question isn't completely clear to me either...