I'm working on a project and would like to scrape article headlines and post date on certain topics from CNN. I did some scraping works before (extract some tables from Wiki) but I failed to extract the information I want in this time. Here is my code:
import requests
from bs4 import BeautifulSoup
link = 'https://www.cnn.com/search?q=tesla&size=10&category=us'
cnn = requests.get(link)
soup = BeautifulSoup(cnn)
soup.find_all(class_="cnn-search__result-headline")
I got nothing from this code. I tried to figure out this problem but did not get the solution, and it bothers me for two days. Many thanks if anyone could help me to solve this problem.