如何在 Wget 或 Python 中获取网页的当前版本?我需要完全关闭缓存。
我正在尝试编写代码以每秒下载http://robocademy.com/courses/arduino/get_code/ 。使用 Python 的 urllib 和 Wget,我无法像在 Chrome 中那样获取当前文件。我试过了
wget --cache=off --user-agent="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" http://robocademy.com/courses/arduino/get_code/
和 urllib 与 urllib.urlcleanup
chrome中的响应标头:
Accept-Ranges:bytes
Age:0
Connection:keep-alive
Content-Encoding:gzip
Content-Length:449
Content-Type:text/plain
Date:Wed, 28 Nov 2012 23:20:24 GMT
Server:nginx
Vary:Accept-Encoding
Via:1.1 varnish
X-Varnish:400211059
Wget 中的响应标头
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/plain
Keep-Alive: timeout=20
Vary: Accept-Encoding
Transfer-Encoding: chunked
Date: Wed, 28 Nov 2012 23:22:20 GMT
X-Varnish: 400216320 400212892
Age: 76
Via: 1.1 varnish
Connection: keep-alive