I want to send variables into find_all(), this is my code:
import requests
from bs4 import BeautifulSoup
url = 'https://www.elheraldo.co'
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
new = soup.find_all(class_=['titulo'])
In the example above I'm using a two constants, the url and class_=['titulo'] but I want to automate this considering this data:
newspapers = {'https://www.elheraldo.co': "class_=['titulo']",
'https://www.zonacero.com': "'div', class_=['title']",
'https://www.elpilon.com.co': "class_=['land-see-post-title']",
'https://www.eluniversal.com.co': "'div', class_=['headline']",
'https://www.diariodelcesar.com': "'h2', class_=['title']",
'https://www.hoydiariodelmagdalena.com.co': "'h2', class_=['title']",
'https://www.diariodelnorte.net': "'h3', itemprop=['name']"}