Browser Automation Comparisons
There are other fantastic browser automation projects, below will compare and contrast
them to mokr.
Notable Changes from Pyppeteer
While forked from pyppeteer, there are some notable changes beyond reformating,
refactoring, and restructuring! Including, but not limited to…
Changed:
The
NetworkManagerhas been overhauled. The new Chrome implementation is based off ofpuppeteerheavily, but is not 1:1 with it. It uses the fetch domain instead of just the network domain.Request interception is enabled by default. Can be disabled with
Page.set_request_interception_enabled(False)(on Chrome, Firefox is always on).Browser.createhas been replaced withBrowser.readyand accepts no keyword arguments. This means aBrowsercan be instantied and target discovery postponed until.ready()is called.The
launchmethod is top-level and offers an async context manager to better handle graceful exits.Firefox only: Temporary extensions can be installed at browser launch.
CDPSessionis nowDevtoolsSessionand shares a base class withConnection, calledRemoteConnection.
New:
Partial Firefox support.
There is a new class,
FetchDomainthat can be used to send fetch requests viaPage.fetch(this calls the page’s instantiatedFetchDomainobject).Another new class,
HttpDomainis available to send ad hoc requests via anhttpx, HTTP2-enabled, client that syncs it’s cookies with the parentPageand vice-versa.Proxy support is baked-in, meaning you can pass a
proxystring tomokr.launchdirectly.New
EventWaiterclass; based off ofpyppeteer.helper.waitForEventmethod.
Removed:
Tracing has been removed.
ElementHandle.querySelectorEvaland.querySelectorAllEvalhave been removed.
Compared
Huge thanks are owed to the contributors of all the below projects, without them, this project would be quite different.
The disadvantages below are not a knock on any of these projects or their contributors.
| Package | Advantages | Disadvantages |
|---|---|---|
| playwright-python |
|
|
| puppeteer |
|
|
| pyppeteer |
|
|