r/webscraping • u/TurgeOmri • May 15 '23
really need help with web scraping
im working on webscraping, and I really need someone to show me how can I arrange specific jsons in relation to the info, for example get the value for the id, article and author,
4
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
1
5
u/niameyy May 15 '23
Did you just leak your api key? You may want to change it.