Это код:
Код: Выделить всё
def check_ticker(soup, ticker_c):
tables = soup.findAll("table", {"class": "dual_border_data_table"})
company_name = ""
if len(tables) > 0:
bm_table = tables[0]
rows = bm_table.findAll("tr")
row = rows[1]
cells = row.findAll("td")
if cells[0].get_text() == ticker_c:
cn = cells[1].get_text()
company_name = cn
else:
company_name = ""
else:
b = soup.findAll("div", {"class": "ticker_nomatches"})
if len(b) > 0:
company_name = ""
return company_name
Код: Выделить всё
ESS PW
KKD US
QVCA US
HAR US
LXK US
WWAV US
HEN3 GR
036220 KS
CIG PW
068420 KS
6767 JP
OVTI US
SCTY US
CSC US
STRZA US
ISG LN