I have been trying to read a find out what the beautifulsoup package is in python, but I cannot seem to understand it
CodePudding user response:
try this
import requests
from bs4 import BeautifulSoup as bs
import io
from PyPDF2 import PdfFileReader
URL = 'https://www.comafi.com.ar/custodiaglobal/eventos-corporativos.aspx'
FILETYPE = '.pdf'
FILENAME = 'Anuncio de dividendo'
def get_soup(url):
return bs(requests.get(url).text, 'html.parser')
date = '13/09/22'
for link in get_soup(URL).find_all('tr'):
for i in link.find_all('td'):
if i.get('class')[0] == 'td-fecha' and i.text == '13/09/22':
cedar_link = link.find('a').get('href')
file_link = link.find('a').get('title')
if FILETYPE in cedar_link:
if FILENAME in file_link:
print(cedar_link)