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-2.0.2.tar.gz (25.1 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-2.0.2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for browser_automation_launcher-2.0.2.tar.gz
Algorithm Hash digest
SHA256 bd1d4a7468b70e123401b2a1d0d2be13b88436e0c01f4e876a06955159a28d98
MD5 785f4fc6212cb1ae23e8a51f618e88f4
BLAKE2b-256 14f24a567f2b1e93493340afc8df6cc6529a1a4f0d7f7d1b5671d77451d879ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for browser_automation_launcher-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a50623cb4a22c17c94733d0b1e971fc214d825fc1e2c71c058d037199830b401
MD5 e024fca91c307c6f1dee88dcb62262bc
BLAKE2b-256 170465745f64115ed261b08755ac31d306a39658184f938abab3294f44d66834

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