Skip to content

Instantly share code, notes, and snippets.

@NEJmark
Last active July 8, 2016 02:10
Show Gist options
  • Save NEJmark/4a98f06059a3cecc7af6 to your computer and use it in GitHub Desktop.
Save NEJmark/4a98f06059a3cecc7af6 to your computer and use it in GitHub Desktop.
#import lxml.etree as etree
#etree.HTML(data)
page.xpath('//tr/td[contains(text(),"2015/09/09")]/following-sibling::*')
#取得tr下td 屬性中的文字包含2015/09/09其之後所有的td節點
page.xpath('//td[@class="cr"])
#取得所有 屬性class = cr 的td節點
#or opteration
page.xpath('(.//tr[@class="even"]|.//tr[@class="odd"])')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment