Skip to main content

get-pwbrowser-sync

[tests]pythonCode style: blackLicense: MITPyPI version

Instantiate a playwright firefox sync (as opposed to async) browser

Installation

pip install get-pwbrowser-sync

# or
# pip install git+https://github.com/ffreemt/get-pwbrowser-sync.git
# python -m playwright install chromium
or via poetry poetry add git+https://github.com/ffreemt/get-pwbrowser-sync.git && python -m playwright install chromium

Usage

from get_pwbrowser_sync import get_pwbrowser_sync

browser = get_pwbrowser_sync()
page = browser.new_page()
page.goto("http://www.baidu.com")
print(page.title())
# '百度一下,你就知道'

Use of .env and os.environ

The browser can be run in a headful manner (to actually see what's going on):

from get_pwbrowser_sync import get_pwbrowser_sync
browser = get_pwbrowser_sync(headless=False)

Some related parameters HEADFUL, DEBUG and PROXY can be set in shell environ or in .env with prefix PWBROWSER_.

e.g., set PWBROWSER_HEADFUL=1 in Windows or export PWBROWSER_HEADFUL=1 in Linux and freinds)

or in .env

# .env
PWBROWSER_HEADFUL=1

For more details have a look at the source code.

Metadata

Release files for get-pwbrowser-sync 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for get-pwbrowser-sync 0.1.3
File Size Uploaded
get_pwbrowser_sync-0.1.3.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for get-pwbrowser-sync 0.1.3
File Interpreter ABI Platform
get_pwbrowser_sync-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / get_pwbrowser_sync-0.1.3.tar.gz

Download URL get_pwbrowser_sync-0.1.3.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b9ced3243361f43dab6157376e708a5e5b9548d298cbb1e91c08cf2c329eded0
BLAKE2b-256 checksum
How to use checksums
0fd7e6b9bdda4f0fad5b2caffade5358b02928df93369a8ab40a92090ce9565d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.8.10 Windows/10

Release files / get_pwbrowser_sync-0.1.3-py3-none-any.whl

Download URL get_pwbrowser_sync-0.1.3-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
653356b726ce72f7aaf7797e17857175201abb959832a99d388ae608b0964380
BLAKE2b-256 checksum
How to use checksums
000ed6596444ab1dc15fd4e96988ca42d9caf155d3d187cc2584a1ad54e2a79f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.8.10 Windows/10
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page