我被分配了一项任务,列出25k个网站,并删除那些关闭/无响应的网站。我想最简单的方法就是: with website in websites:
try:
req = Request(test, headers={"User-Agent": "Mozilla/5.0 (Linux i686)"})
with contextlib.closing(urlopen(req)) as response:
new_list.add(response.geturl())
except:
这段代码以前运行得很好,但从昨天开始出现错误。在阅读了许多类似的讨论之后,我认为我的问题是关于cookie的,所以我添加了一个CookieContainer,但是我仍然得到了相同的错误。我的代码允许我从网站上获取图片和它们的标题,并显示它们,这是我的代码:
表格1:
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Dim websiteURL1 As String = "http://www.gamestop.com/collection/upcoming-vid