DrissionPage Documentation

website·Indexed 32 days ago

http://drissionpage.cn

A browser control and data recording library for Python. It includes features for browser automation, element location using a concise syntax, and a built-in Recorder for managing data in various formats including xlsx, csv, txt, json, jsonl, sqlite (db), and binary files.

Tokens
349.6K
Snippets
2.2K
Records
3.2K
Agent score
64%

What's inside DrissionPage

  1. Overview of DrissionPage

    DrissionPage is a web automation library designed to combine the capabilities of browser control (similar to Selenium's WebDriver) and data packet transmission (similar to requests' Session). The name 'Drission' is a portmanteau of 'Driver' and 'Session'. It aims to provide a more concise syntax for element location, faster execution, and a unified API for both browser-based and request-based interactions.
  2. Overview of TimePinner

    TimePinner is a simple timing tool for Python, functioning similarly to a stopwatch in code. It allows developers to mark multiple time points to record the duration of various segments. Each segment can be named for easier identification, and users can skip time intervals that do not require recording.
  3. Overview of DrissionPage DownloadKit features

    DrissionPage page objects include a built-in download tool (implemented via the DownloadKit library) that wraps requests. It is not a browser-native download call, meaning custom headers and data must be manually provided if required by the target server. Key features include:

    • Multi-threaded concurrent downloads of multiple files.
    • Automatic chunked multi-threaded downloading for large files.
    • Support for POST requests and custom connection parameters.
    • Automatic target path creation and illegal character removal from filenames.
    • Automatic handling of filename conflicts and task retries on failure.
    • Ability to append data to existing files.
  4. Overview of DrissionPage DownloadKit capabilities

    DrissionPage includes a built-in download tool (available as a standalone library called DownloadKit) integrated into several page objects. It is implemented as a wrapper around the requests library, meaning it does not use browser-native download functions. If the target server requires specific headers or data, they must be provided manually.

    Supported objects:

    • SessionPage
    • ChromiumTab
    • MixTab
    • ChromiumFrame
    • ChromiumPage
    • WebPage

    Key features include:

    • Multi-threaded concurrent downloads of multiple files.
    • Automatic chunking for large files using multi-threading.
    • Appending data to existing files.
    • Automatic target path creation and illegal character removal from filenames.
    • Filename conflict handling and renaming.
    • Support for POST requests and custom connection parameters.
    • Automatic retries on failure.
  5. Overview of DrissionPage

    DrissionPage is a Python library designed for web automation that combines the capabilities of browser control (similar to WebDriver) and data packet transmission (similar to requests). It was created to overcome the verbosity and limitations of Selenium, such as the dependency on chromedriver, complex explicit wait syntax, and difficulties in managing multiple tabs or frames.

    Key advantages include:

    • Unified API for both browser control and request-based data retrieval.
    • Shared cookies between browser and request modes.
    • Faster execution compared to Selenium.
    • Ability to bypass some human-machine detection tools (e.g., Cloudflare, Google).
    • No dependency on chromedriver in versions 3.x and above.
  6. Overview of DrissionPage Architecture

    DrissionPage is a web automation library that integrates browser control (similar to Selenium/Driver) and HTTP request-based data retrieval (similar to requests/Session) into a single framework. It allows developers to switch between a browser-driven mode and a packet-driven mode within the same page object to balance speed and capability.
  7. Overview of DrissionPage

    DrissionPage is a web automation library designed to combine the capabilities of browser control (similar to Selenium's WebDriver) and data packet transmission (similar to requests' Session). It aims to provide a more concise syntax for element searching, better stability, and higher performance than traditional tools by integrating browser-based and request-based operations into a single page-oriented framework.
  8. Overview of DrissionGet features

    DrissionGet is a concise and powerful multi-threaded file download tool for Python. Key features include:

    • Multi-threading for simultaneous file downloads and automatic chunking of large files.
    • Automatic task scheduling and simple task addition.
    • Support for existing Session objects to maintain login states.
    • Full compatibility with DrissionPage.
    • Automatic target path creation and removal of illegal characters from paths.
    • Automatic handling of filename conflicts.
    • Ability to append content to existing files.
    • Automatic retries upon connection failure.
  9. Overview of DrissionPage core capabilities

    DrissionPage uses a self-developed kernel that provides several advantages over traditional WebDriver-based tools:

    • No WebDriver dependency: No need to download or manage different driver versions for different browsers.
    • Performance: Faster execution speeds.
    • Advanced Element Access: Can find elements across iframes without switching contexts and can handle shadow-roots that are not in the open state.
    • Multi-tasking: Can operate multiple tabs simultaneously without needing to switch between them.
    • Network Tools: Includes built-in packet listening capabilities.