-
Notifications
You must be signed in to change notification settings - Fork 1
/
scraper.py
20 lines (19 loc) · 971 Bytes
/
scraper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
etf = []
etf_list = open("list.txt","w")
with open("t212.txt") as data:
for line in data:
if 'ETF' in line:
line = line.replace('&', '&')
line = line.replace(' data-label="Company">', '')
line = line.replace('</div><div class="d-cell hidden js-cell js-target"', '')
line = line.replace(' data-label="ISIN">DE000ETFL011</div><div class="d-cell hidden js-target"', '')
line = line.replace(' data-label="ISIN">DE000ETFL235</div><div class="d-cell hidden js-target"', '')
line = line.replace(' data-label="Instrument">ETFC</div><div class="d-cell hidden js-cell js-target d-cell--break"', '')
if line == '\n':
pass
else:
etf.append(line)
del etf[0]
etf_list.writelines(etf)
etf_list.close()
print(etf)