Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


You are required to scrap data from imdb top 250 movies page. It should only have fields movie name, year, and rating.



You are required to scrap data from imdb top 250 movies page. It should only have fields movie name,..

Answer / Anamika

To scrape data from the IMDb top 250 movies page, you can use a web scraping library such as BeautifulSoup. Here's a basic example of how to extract movie name, year, and rating using BeautifulSoup and requests:nn```pythonnimport requestsnfrom bs4 import BeautifulSoupnnurl = 'https://www.imdb.com/chart/top/' nresponse = requests.get(url)nsoup = BeautifulSoup(response.content, 'html.parser')nnmovies = soup.find_all('td', {'class': 'titleColumn'})nnfor movie in movies[:25]:n name = movie.a['title']nyear = int(movie.find('span', {'class': 'secondaryInfo'}).text[1:5].strip())nrating = float(movie.strong.text)n print(f'{name} - {year} - Rating: {rating}')n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do you find the number of references pointing to a particular object?

1 Answers  


Does python support switch or case statement in Python? If not what is the reason for the same?

1 Answers  


How to give comments in python?

1 Answers  


What is Python Set?

1 Answers  


What is os module?

1 Answers  


How do you use modulus in python?

1 Answers  


Can you learn python with no experience?

1 Answers  


What is python? What do you understand of pep 8?

1 Answers  


What are the nameless functions in python?

1 Answers  


What is python and python scripting?

1 Answers  


Do you know how is memory managed in python?

1 Answers  


How will you capitalize the first letter of string?

4 Answers  


Categories