import requests
import bs4
import pandas as pd
rq = requests.get('https://www.imdb.com/chart/top') //I'm using https://imdb.com
bs = bs4.BeautifulSoup(rq.text , 'lxml')
bs.select('.titleColumn' )
lst = [i.text for i in bs.select('.titleColumn')]
print(lst)
lst1=[s.replace('\n', '') for s in lst] # remove all the \n
print(lst1)
Movies = pd.DataFrame(lst1 , columns = ['Movies'])
Movies
Movies.to_csv('Top250_movie_by_ratings.csv' , index = False)
"""Saved successfully as CSV file """
2 Using web scrapping to get movie names