2015-01-27から1日間の記事一覧

Beautiful soup 同じ階層の要素を列挙

現在の階層からルートまで検索したい時があったので while elm is not None: for next in elm.next_siblings: print next.name for prev in elm.previous_siblings: print prev.name elm = elm.parent if elm is not None: print elm.name1.後の要素をすべ…