Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
Created March 19, 2011 09:07
Show Gist options
  • Save laclefyoshi/877354 to your computer and use it in GitHub Desktop.
Save laclefyoshi/877354 to your computer and use it in GitHub Desktop.
東京大学環境放射線情報 最新暫定値取得
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright : (c) SAEKI Yoshiyasu
# License : MIT-style license
# <http://www.opensource.org/licenses/mit-license.php>
# last updated: 2011/03/19
import lxml.html
root = lxml.html.parse("http://www2.u-tokyo.ac.jp/erc/index.html")
row = root.xpath("//table/tbody/tr[last()]")[0]
print row.xpath("td[1]")[0].text.strip(), row.xpath("td[2]")[0].text.strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment