ITeye博客

xpath Tricks

eonbell · 2011-02-25 13:36 · 编程语言 · Markdown

how to find the text following "" tag

for example: html source code as below: Blood Substitutes (HBOCs): Is There a Downside? Small Animal > Emergency Medicine & Critical Care Tuesday | 8:00 AM - 8:50 AM | Mandalay Bay South Pacific F we can find out the text following by below summar
detail = root_dom.xpath(".//h3/br/following-sibling::text()") (session_date,session_time,session_room) = detail.split("|") of course we can find out the text before tag like this: detail = root_dom.xpath(".//h3/br/preceding-sibling::text()")

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。