<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takeshi0406</author_name>
  <author_url>https://blog.hatena.ne.jp/takeshi0406/</author_url>
  <blog_title>歩いたら休め</blog_title>
  <blog_url>https://kiito.hatenablog.com/</blog_url>
  <categories>
    <anon>asyncio</anon>
    <anon>スクレイピング</anon>
    <anon>pyppeteer</anon>
  </categories>
  <description>Pythonから簡単にHeadless Chromeを利用できるpyppeteerというライブラリがあります。Headless Chromeの操作をラップしてくれてかなり便利なのですが、ほとんどの関数やメソッドが非同期(async)ｎあので、しばらく遊んでasync/awaitを使った実装に慣れる必要がありそうです。 ただ、公式リポジトリのサンプルコードを見ても分かる通り、browser.newPage()やclose()などの前処理・後処理のコードがあります。 async def main(): browser = await launch() page = await browser.ne…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkiito.hatenablog.com%2Fentry%2F2018%2F12%2F07%2F235518&quot; title=&quot;【Python】pyppeteerを非同期コンテクストマネージャー用のクラスでラップして遊ぶ - 歩いたら休め&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>2018-12-07 23:55:18</published>
  <title>【Python】pyppeteerを非同期コンテクストマネージャー用のクラスでラップして遊ぶ</title>
  <type>rich</type>
  <url>https://kiito.hatenablog.com/entry/2018/12/07/235518</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
