Screen Link:
My Code:
import requests
for year in years:
url = url_start.format(year)
data = requests.get(url)
with open("MVP/{}.html".format(year), "w+") as f:
f.write(data.text)
Replace this line with your code
What I expected to happen:
What actually happened:
Replace this line with the output/error
UnicodeEncodeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_13372/3323775649.py in
6
7 with open(“MVP/{}.html”.format(year), “w+”) as f:
----> 8 f.write(data.text)
~\anaconda3\lib\encodings\cp1252.py in encode(self, input, final)
17 class IncrementalEncoder(codecs.IncrementalEncoder):
18 def encode(self, input, final=False):
—> 19 return codecs.charmap_encode(input,self.errors,encoding_table)[0]
20
21 class IncrementalDecoder(codecs.IncrementalDecoder):
UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\u010d’ in position 181692: character maps to
Attempting to pull years 1991-2022 into my jupyter lab folder named “MVP”