r/webscraping • • May 15 '23

really need help with web scraping

0 Upvotes

11 comments sorted by

5

u/niameyy May 15 '23

Did you just leak your api key? You may want to change it.

4

u/[deleted] May 15 '23

learn how to use dictionary and list and for loop

1

u/nib1nt May 15 '23

When did you start learning python? Do you know loops?

1

u/TurgeOmri May 15 '23

started before couple of days, do you mean for loops? while loops? i indeed know for loops.

5

u/nib1nt May 15 '23

Try something like:

for article in api['articles']:  
  print(article['source']['id'], article['source']['name'])

2

u/kenzotemna May 15 '23

Try using some online JSON beautifier to see how the data is structured. After that its just basic python dictionaries manipulation and traversal

1

u/[deleted] May 16 '23

You can use a dictionary

1

u/AggressiveRub9434 May 16 '23

Ask chatgpt to parse the data for you if you're in a rush