Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
只要工作允许,我仍在以我的方式围绕 python 工作......
我正在使用使用urllib2.urlopen. 我想知道如何从每个请求中获取页面内容的大小。我似乎无法弄清楚这一点。
urllib2.urlopen
提前致谢,
米宾
print len(urlopen(url).read())
或者
>>> result = urllib2.urlopen('http://www.spiegel.de') >>> result.headers['content-length'] '181291'