My objective with this code is to scrap the allocation of brazilian funds.
PATH = (r"C:\Users\gustavo.vieira\Desktop\python\drivers\msedgedriver.exe")
funds_list = ['VINLAND MACRO MASTER FUNDO DE INVESTIMENTO MULTIMERCADO']
url = 'https://cvmweb.cvm.gov.br/SWB/Sistemas/SCW/CPublica/CConsolFdo/FormBuscaParticFdo.aspx'
for i in funds_lista:
driver = webdriver.Edge(PATH)
driver.get(url)
search = driver.find_element_by_name("txtCNPJNome")
search.send_keys(i)
search.send_keys(Keys.RETURN)
driver.find_element_by_link_text(i).click()
font = driver.find_element_by_link_text('Composição da Carteira').click()
soup = BeautifulSoup(font)
rows = soup.find_all("tr")
print(rows)
My problem starts with bs4, I already tried to scrap the table using soup.find_all('table', id ='dlAplics'), or using (class_, all of them return an error. I already saw a lot of videos but I'm feeling unable to solve that by myself right now.