I am starting out in python and when doing a web scraping in python it won't show the whole list I will leave the code there, I was trying to pull the A24 films ranked in IMDB
from cmath import e
from pydoc import synopsis
from bs4 import BeautifulSoup
import requests
try:
source =requests.get('https://www.imdb.com/list/ls024372673/')
source.raise_for_status()
soup=BeautifulSoup(source.text,'html.parser')
movies=soup.find('div',class_="lister-list").find_all('div')
for movie in movies :
name= movie.find('h3',class_="lister-item-header").a.text
rank= movie.find('span',class_="lister-item-index unbold text-primary").text
year= movie.find('span',class_="lister-item-year text-muted unbold").text
star= movie.find('span',class_="ipl-rating-star__rating").text
metascore= movie.find('div',class_="inline-block ratings-metascore").span.text
score=movie.find('div',class_="list-description").text
genre=movie.find('span',class_="genre").text
runtime=movie.find('span',class_="runtime").text
about=movie.find('p',class_="").text
elements = movie.findAll('span', attrs = {'name':'nv'})
votes = elements[0]['data-value']
gross = elements[1]['data-value']
print(name,rank,year,star,metascore,score,genre,runtime,about,votes,gross)
except Exception as e:
print(e)
print(name, rank, ...so that it is inside thefor movie in movies:loop?