【问题标题】:BeautifulSoup Scraping Results not showingBeautifulSoup 抓取结果未显示
【发布时间】:2022-12-03 16:56:18
【问题描述】:

I am playing around with BeautifulSoup to scrape data from websites. So I decided to scrape empireonline\'s website for 100 greatest movies of all time.

Here\'s the link to the webpage: https://www.empireonline.com/movies/features/best-movies-2/

I imported the HTML from the site quite alright, I was able to use beautiful soup on it. But when I wanted to get the list of the 100 movie titles, I was getting an empty list. Here\'s the code I wrote below.

import requests
from bs4 import BeautifulSoup

URL = \"https://www.empireonline.com/movies/features/best-movies-2/\"

response = requests.get(URL)
top100_webpage = response.text

soup = BeautifulSoup(top100_webpage, \"html.parser\")
movies = soup.find_all(name=\"h3\", class_=\"jsx-4245974604\")
print(movies)

When I ran the code, the result was an empty list. I changed my parsing library to lxml and html5lib but I was still getting the same empty list.

Please how can I resolve this issue?

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it\'s currently written, it\'s hard to tell exactly what you\'re asking.
  • Does this answer your question? Beautiful soup Scrape Movie Titles and Images

标签: python web-scraping beautifulsoup lxml.html


【解决方案1】:
【解决方案2】:
【解决方案3】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-25
  • 2017-06-14
  • 2015-11-23
  • 1970-01-01
  • 2018-03-28
  • 2019-01-20
相关资源
最近更新 更多