{"provider_url":"https://hatena.blog","title":"BeautifulSoup \u306e\u4ee3\u308f\u308a\u306bElementTree \u3092\u4f7f\u3063\u3066\u307f\u305f(\u7d9a\u304d)","image_url":null,"author_name":"gust_notch","version":"1.0","blog_title":"GUST NOTCH? DIARY","provider_name":"Hatena Blog","type":"rich","width":"100%","url":"https://gust-notch.hatenablog.jp/entry/2024/06/06/193906","categories":["Pythonista","iPad"],"published":"2024-06-06 19:39:06","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgust-notch.hatenablog.jp%2Fentry%2F2024%2F06%2F06%2F193906\" title=\"BeautifulSoup \u306e\u4ee3\u308f\u308a\u306bElementTree \u3092\u4f7f\u3063\u3066\u307f\u305f(\u7d9a\u304d) - GUST NOTCH? DIARY\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://gust-notch.hatenablog.jp/","author_url":"https://blog.hatena.ne.jp/gust_notch/","height":"190","description":"\u6628\u65e5\u306e\u7d9a\u304d\u3002 \u4eca\u5ea6\u306fxml\u3092\u8aad\u307f\u66f8\u304d\u3059\u308b\u51e6\u7406\u3002 \u8aad\u3080\u90e8\u5206\u306f BeautifulSoup \u3068\u304b\u306a\u308a\u4f3c\u3066\u3044\u305f\u306e\u3067\u601d\u3063\u305f\u3088\u308a\u7d20\u76f4\u306b\u76f4\u305b\u305f\u3002 \u5f15\u3063\u304b\u304b\u3063\u305f\u70b9\u3068\u3057\u3066\u306f\u3001 \u30bf\u30b0\u304c\u306a\u3044\u5834\u5408\u306e\u8fd4\u308a\u5024 \u30bf\u30b0\u306e\u6709\u7121\u3067\u51e6\u7406\u3092\u5206\u5c90\u3055\u305b\u305f\u304f\u3066 tag = parent.find('tagname').text \u3068\u3057\u305f\u5834\u5408\u3001BeautifulSoup \u3067\u306f if tag: \u30bf\u30b0\u304c\u3042\u308b\u5834\u5408\u306e\u51e6\u7406 else: \u30bf\u30b0\u304c\u306a\u3044\u5834\u5408\u306e\u51e6\u7406 \u3067\u52d5\u3044\u3066\u3044\u305f\u306e\u3060\u3051\u3069\u3001ElementTree \u3067\u306f if tag != None : \u30bf\u30b0\u304c\u3042\u308b\u5834\u5408\u306e\u51e6\u7406 else: \u30bf\u30b0\u304c\u306a\u3044\u5834\u5408\u306e\u51e6\u7406 \u306b\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u304b\u3063\u305f\u3002 XML \u4e2d\u306b\u6570\u5024\u304c\u5165\u3063\u3066\u304f\u308b\u2026"}