I am currently breaking on the subjected break. What is this TypeError, and how do I resolve it? What are the necessary amendments required in the code?
from urllib.request import urlretrieve
stoxxeu600_url = urllib.request.urlretrieve('https://www.stoxx.com/document/Indices/Current/HistoricalData/hbrbcpe.txt')
vstoxx_url = urllib.request.urlretrieve('https://www.stoxx.com/document/Indices/Current/HistoricalData/h_vstoxx.txt')
data_folder = 'data/' #Save file to local target destination.
stoxxeu600_filepath = data_folder + "stoxxeu600.txt"
vstoxx_filepath = data_folder + "vstoxx.txt"
urlretrieve(stoxxeu600_url,stoxxeu600_filepath)
This is the output:
File "/home/aryabhatta/anaconda3/lib/python3.6/urllib/parse.py", line 938, in splittype
match = _typeprog.match(url)
TypeError: expected string or bytes-like object