I am trying to parse a value called secu from pages in the format like: https://www.ariva.de/[WKN-input]/historische_kurse
I can find in looking at the source code of the page:
<input type="hidden" name="secu" value="717816" />
E. g.: https://www.ariva.de/A0D9PT/historische_kurse
In the end I would like to store it to a CSV. This is the code I already have, the parse part is missing:
import pandas as pd
# read WKN names from CSV
wkn_list=pd.read_csv('all_wkn_list.csv')
df_output = pd.DataFrame(columns=['wkn', 'secu'])
# loop through WKNs
i=0
for index, row in wkn_list.iterrows():
print(row[0])
url = 'https://www.ariva.de/'+str(row[0])+'/historische_kurse'
# parse secu
secu_parsed = "test"
# store wkn and secu
df_output.loc[i] = [str(row[0])] + [str(secu_parsed)]
i=i+1
# store WKN + secu to CSV
df_output.to_csv('output.csv')
requeststo download the HTML then use beautifulsoup to parse the HTML and extract the value.