尝试将zip文件作为其他选择上载为表单的一部分。尝试对br.form.add_file()进行各种输入后,python仍然会吐出错误。另外不确定我是否需要提供表单上载部分的名称/ ID。
尝试使用ZipFile加载zip并将其直接传递给上传功能,还尝试提供MIME类型和上传文件名。
br.select_form(id='upload_form')
print('Supplying Text...')
br['chapter_name'] = 'test'
br['chapter_number'] = '55'
zip = zips / '16x16.zip'
#with ZipFile(zip, 'r') as zip:
br.form.add_file(open(zip))
print('Submitting form...')
response = br.submit()```
Current setup provides this error: 'charmap' codec can't decode byte 0x9d in position 199: character maps to <undefined>