ブラウザ自動化のスクリプトをPythonで書くとき、Playwrightのsync APIは一番手軽に見えます。ところがAnaconda経由のPython 3.9環境では、これがクラッシュの原因になりました。今回は、そこで決めた「asyncに統一する」ルールと、サイトの改修で壊れやすいセレクタを設定ファイルに隔離する構成をまとめます。 何が起きたか Playwrightを同期APIで書いて動かすと ...
Pythonには、コルーチン、マルチスレッディング、マルチプロセッシングなど、複数の非同期アプローチがあります。さらに、いくつかの従来の方法やサードパーティの非同期ライブラリもあります。この記事では主にコルーチンに焦点を当て、マルチ ...
Learn how to use asynchronous programming in Python 3.13 and higher. Get more done in less time, without waiting. Asynchronous programming, or async, is a feature of many modern languages that allows ...
So far we have looked at processes as a way of increasing the speed of CPU-bound programs, and threads as a way of increasing the speed of I/O-bound programs. In the following chapters the emphasis ...
Your application already uses asyncio (for example, FastAPI, aiohttp, or Discord bots) and you need to integrate database calls without blocking the event loop. Database queries are I/O-bound, not CPU ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する