<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gust_notch</author_name>
  <author_url>https://blog.hatena.ne.jp/gust_notch/</author_url>
  <blog_title>GUST NOTCH? DIARY</blog_title>
  <blog_url>https://gust-notch.hatenablog.jp/</blog_url>
  <categories>
    <anon>Pythonista</anon>
    <anon>iPad</anon>
  </categories>
  <description>昨日の続き。 今度はxmlを読み書きする処理。 読む部分は BeautifulSoup とかなり似ていたので思ったより素直に直せた。 引っかかった点としては、 タグがない場合の返り値 タグの有無で処理を分岐させたくて tag = parent.find('tagname').text とした場合、BeautifulSoup では if tag: タグがある場合の処理 else: タグがない場合の処理 で動いていたのだけど、ElementTree では if tag != None : タグがある場合の処理 else: タグがない場合の処理 にしないといけなかった。 XML 中に数値が入ってくる…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgust-notch.hatenablog.jp%2Fentry%2F2024%2F06%2F06%2F193906&quot; title=&quot;BeautifulSoup の代わりにElementTree を使ってみた(続き) - GUST NOTCH? DIARY&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-06-06 19:39:06</published>
  <title>BeautifulSoup の代わりにElementTree を使ってみた(続き)</title>
  <type>rich</type>
  <url>https://gust-notch.hatenablog.jp/entry/2024/06/06/193906</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
