【发布时间】:2015-04-21 04:09:41
【问题描述】:
我想通过以下方式下载一堆url列表:
urllib.request.urlretrieve(url, filename)
但遗憾的是,很少有链接被破坏。当 urlretrieve 遇到那个断开的链接时
Traceback (most recent call last):
File "D:/Users/hyungsoo/PycharmProjects/untitled/check.py", line 71, in <module>
....blah_blah....
urllib.error.HTTPError: HTTP Error 404: Not Found
给我这个错误标志然后程序退出。
如何传递损坏的url?
另外,有没有可能程序告诉我哪个链接坏了?
【问题讨论】:
-
你能发布你的网络代码吗?
标签: url python-3.x download http-status-code-404