{"published":"2019-07-18 18:33:22","blog_title":"\u60f0\u529b\u98db\u884c","author_name":"lingvisticae","blog_url":"https://livingdead0812.hatenablog.com/","height":"190","image_url":null,"provider_name":"Hatena Blog","type":"rich","description":"\u69cb\u9020\u3092\u5909\u3048\u305a\u306b\u5c5e\u6027\u3084\u30c6\u30ad\u30b9\u30c8\u306b\u7de8\u96c6\u3092\u52a0\u3048\u308b\u5834\u5408 \u8aad\u307f\u8fbc\u3093\u3060\u30d5\u30a1\u30a4\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08Element\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u76f4\u63a5\u7de8\u96c6\u3057\uff0c\u5225\u540d\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u3063\u3066\u66f8\u304d\u51fa\u3059\uff0e from lxml import etree as ET tree = ET.parse(filename) root = tree.getroot() # \u7de8\u96c6\u3059\u308b\u30c6\u30ad\u30b9\u30c8\u3092XPath\u3067\u53d6\u308a\u51fa\u3057\uff0c\u7de8\u96c6 for t in root.findall('./path/to/node'): t.text = t.text.replace('hoge', 'huga') # ElementTree\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u66f4\u3092\u53cd\u6620\u3057\uff0c\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3059 \u2026","width":"100%","title":"xml\u3092\u7de8\u96c6\u30fb\u751f\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306e\u5099\u5fd8","version":"1.0","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Flivingdead0812.hatenablog.com%2Fentry%2F2019%2F07%2F18%2F183322\" title=\"xml\u3092\u7de8\u96c6\u30fb\u751f\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306e\u5099\u5fd8 - \u60f0\u529b\u98db\u884c\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://livingdead0812.hatenablog.com/entry/2019/07/18/183322","author_url":"https://blog.hatena.ne.jp/lingvisticae/","categories":["python"]}