T
T
tea4panda2020-07-09 10:19:20
Python
tea4panda, 2020-07-09 10:19:20

How to parse multiple links at once in python?

Hello!
I've been struggling with this question for a long time and I just can't figure it out...
I have a list url_list: [url1, url2, url3...]
how to open all links correctly if they are json?
when I try to do it in a loop, it says that expected an indented block

I can usually open a single link like this.
response = requests.get(a)
b = response.content
dataString = b dataJson = json.loads
(dataString)
for i in dataJson['data']:
print(i['price'], i['company']

Thanks for your help, I'll be very grateful!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ronald McDonald, 2020-07-09
@tea4panda

writes that expected an indented block

This is not related to the logic of the program, make out the formatting.
Use cycles, oh my.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question