タグ

lxmlに関するYoshioriのブックマーク (2)

  • Web::Scraper in Python (もしくは scrAPI in Python) - rants

    lxml2.0からCSSSelectorが導入されたので、Web::Scraperのようなものを作ってみました。 とりあえず動作するところまでいったので載せておきます。機能はまだ全然足りてないので、簡単なことしかできません。 Python2.5とlxml2.0alpha が必要です。 Pythonはリストや辞書の中にある日語をそのままprintで表示できないようなので、めんどくさいことに全部stringにして出力してます。 Web::Scraper - naoyaのはてなダイアリーよりキーワードページから必要なデータをもってくる例。 #!/usr/bin/env python2.5 from scraper import scraper, process import codecs, sys sys.stdout = codecs.getwriter('utf-8')(sys.stdou

    Web::Scraper in Python (もしくは scrAPI in Python) - rants
  • tokuhirom blog

    Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at

    Yoshiori
    Yoshiori 2008/08/06
    Pure Python だと Jython や IronPython で使いやすいとかもあるかも
  • 1