<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>cheeseshop</author_name>
  <author_url>https://blog.hatena.ne.jp/cheeseshop/</author_url>
  <blog_title>Pythonを書く</blog_title>
  <blog_url>https://cheeseshop.hatenadiary.org/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>タイムアウトの設定についてはPython 2.6以降urllib.urlopenerのオプション引数でサポートされるようになりました。後ほど書き直します。 urllib.URLopenerはすべてのエラーをIOErrorで返します。except文はひとつで済むのですが、DNSのエラー、タイムアウト、URLの不正形式からHTTPサーバにおけるNotFound、認証要求、リダイレクトまで全部一緒に扱われてしまいます。エラーの内容によって処理を振り分けたい場合、error valueを取って調べることになります。 e.errno e.strerror e.args ============== ==…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcheeseshop.hatenadiary.org%2Fentry%2F20070816%2F1198186296&quot; title=&quot;urllib.URLopenerのエラーを詳しく検出する - Pythonを書く&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>2007-08-16 06:31:36</published>
  <title>urllib.URLopenerのエラーを詳しく検出する</title>
  <type>rich</type>
  <url>https://cheeseshop.hatenadiary.org/entry/20070816/1198186296</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
