推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
omg21
V2EX  ›  Python

如何获取网站页面的更新时间?

  •  
  •   omg21 · Apr 18, 2016 · 2889 views
    This topic created in 3677 days ago, the information mentioned may be changed or developed.
    在浏览器中输入 javascript:alert(document.lastModified) 可以获取网站上 html 页面的更新时间,那么在 Python 中,应该如何做?
    SlipStupig
        1
    SlipStupig  
       Apr 18, 2016
    >>> k = lambda x: requests.head(x).headers['Date']
    >>> k('http://v2ex.com')
    'Mon, 18 Apr 2016 13:56:07 GMT'
    omg21
        2
    omg21  
    OP
       Apr 18, 2016
    @SlipStupig 这不是我要的结果,我表述有误,我想要的是页面的上传时间,或者说是页面的建立时间
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5458 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 05:53 · PVG 13:53 · LAX 22:53 · JFK 01:53
    ♥ Do have faith in what you're doing.