正在尝试使用Selenium下载pdf
我的代码
bills_href = selenium_controller.search_bills(browser)
for count,i in enumerate(bills_href):
r = requests.get(i, stream=True,verify=False)
with open(("python%s.pdf")%(count), "wb") as pdf:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
pdf.write(chunk)
bills_href = list of links of pdf
但是当我打开我的PDF文件时,它显示它已损坏 甚至打不开
目前没有回答
相关问题 更多 >
编程相关推荐