Skip to main content

Browser automation launcher

Project description

browser-automation-launcher

浏览器自动化启动器. 与 DrissionPage 配合使用, 实现浏览器自动化的启动和关闭.

主要功能

  • 自动启动浏览器并设置浏览器参数, 例如调试端口号等 (需要指定 Chrome 浏览器的路径)
  • 通过端口号接管当前已打开的 Chrome 浏览器 (只能接管通过调试模式打开的浏览器)
  • 自动创建或加载浏览器用户数据目录

安装

pip install browser-automation-launcher

使用方法

from BrowserAutomationLauncher import BrowserInitOptions, Launcher

launcher = Launcher()

init_options = BrowserInitOptions()
init_options.set_basic_options(
    browser_path=r'C:\Program Files\Google\Chrome\Application\chrome.exe'
)
# 设置浏览器窗口大小 (可选)
init_options.set_window_loc(width=1400, height=900, x=20, y=20)

browser = launcher.init_browser(init_options)
page = browser.chromium.latest_tab

page.get('https://www.baidu.com')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

browser_automation_launcher-1.0.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

browser_automation_launcher-1.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file browser_automation_launcher-1.0.3.tar.gz.

File metadata

File hashes

Hashes for browser_automation_launcher-1.0.3.tar.gz
Algorithm Hash digest
SHA256 665a5e7b74fd6993dcd0ac6eaf15f0ceb45a0b488d1be1aa20f375b5f0fee549
MD5 a3cc3c1907ec119a0554d141015f2ed2
BLAKE2b-256 a08879c134dee9ba58c33595680be5cac134242259b27597b66a814d45130b6a

See more details on using hashes here.

File details

Details for the file browser_automation_launcher-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for browser_automation_launcher-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d822ab02522ca74580ead14c756f3332b6eaee0524b14d9b4b7f2ca3dd463bd9
MD5 5a7141b8608cbc339c870c43c0542f00
BLAKE2b-256 c4d79174c8b238b8e256c5697b7ac2dd901c87ae1f647f2c82fbc5d292c065af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page