Python / Spyder Script: Script parser

User Generated

PbaarePJ

Programming

Description

Create a script named parser.py

Your script should define a function run() that accepts the url to a movie on RottenTomatoes. It should then create a text file that includes the following information for each review in the first 2 review pages for the movie:

- the name of the critic

- the rating. The rating should be 'rotten' , 'fresh', or 'NA' if the review doesn't have a rating.

- the source (e.g 'New York Daily News') of the review. This should be 'NA' if the review doesn't have a source.

- the text of the review. This should be 'NA' if the review doesn't have text.

- the date of the review. This should be 'NA' if the review doesn't have a date.

The file should include one line for each review. The reviews in the file should appear in the same order as they do on the website. The 5 values that you write for each movie should be written in the order listed above. The 5 values should be separated by a TAB.

Notes:- Your script will be used to extract the critic, rating, source, date, and text of 40 reviewers from 2 pages of reviews on RottenTomatoes. Each of the total 40x5=200 fields is worth 10/200=0.05 points. If you return all of them correctly, you get 10 points.

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hi there, kindly check on t...


Anonymous
Just what I needed…Fantastic!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags