Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can someone explain what the beautifulsoup package does

I have been trying to read a find out what the beautifulsoup package is in python, but I cannot seem to understand it

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading