Skip to content
Advertisement

Parsing JSON web scraper output

I am practicing web scraping using the requests and BeautifulSoup modules on the following website:

https://www.imdb.com/title/tt0080684/

My code thus far properly outputs the json in question. I’d like help in extracting from the json only the name and description into a response dictionary.

Code

JavaScript

Desired Output

JavaScript

Advertisement

Answer

You can parse the dictonary and then print a new JSON object using the dumps method:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement