mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
prop()改成property(),参数改为name; get_src()改为src(); get_cookies()方法改成cookies(); 删除cookies属性; get_session_storage()、get_local_storage()改成session_storage()、local_storage(); pageLoad改成page_load; set_a_header()、remove_a_header()、set.header()、set.attr()的参数改为name; 元素增加value属性和set.value()方法; loc_or_ele、loc_or_str等改为locator; 提高截图jpg格式画质; 修复s模式timeout参数失效问题; 修复wait.has_rect()等出现的问题; 修复找不到浏览器路径时报ini错误问题 增加一些提示
121 lines
3.0 KiB
Python
121 lines
3.0 KiB
Python
# -*- coding:utf-8 -*-
|
|
"""
|
|
@Author : g1879
|
|
@Contact : g1879@qq.com
|
|
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
|
@License : BSD 3-Clause.
|
|
"""
|
|
|
|
from typing import Tuple, Union
|
|
|
|
from .._elements.chromium_element import ChromiumElement
|
|
from .._pages.chromium_base import ChromiumBase
|
|
from .._pages.chromium_frame import ChromiumFrame
|
|
from .._pages.chromium_page import ChromiumPage
|
|
from .._pages.chromium_tab import ChromiumTab, WebPageTab
|
|
from .._pages.web_page import WebPage
|
|
|
|
|
|
class ElementRect(object):
|
|
def __init__(self, ele: ChromiumElement):
|
|
self._ele: ChromiumElement = ...
|
|
|
|
@property
|
|
def size(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def location(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def midpoint(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def click_point(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def viewport_location(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def viewport_midpoint(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def viewport_click_point(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def screen_location(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def screen_midpoint(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def screen_click_point(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def corners(self) -> Tuple[Tuple[float, float], ...]: ...
|
|
|
|
@property
|
|
def viewport_corners(self) -> Tuple[Tuple[float, float], ...]: ...
|
|
|
|
def _get_viewport_rect(self, quad: str) -> Union[list, None]: ...
|
|
|
|
def _get_page_coord(self, x: float, y: float) -> Tuple[float, float]: ...
|
|
|
|
|
|
class TabRect(object):
|
|
def __init__(self, page: ChromiumBase):
|
|
self._page: Union[ChromiumPage, ChromiumTab, WebPage, WebPageTab] = ...
|
|
|
|
@property
|
|
def window_state(self) -> str: ...
|
|
|
|
@property
|
|
def window_location(self) -> Tuple[int, int]: ...
|
|
|
|
@property
|
|
def page_location(self) -> Tuple[int, int]: ...
|
|
|
|
@property
|
|
def viewport_location(self) -> Tuple[int, int]: ...
|
|
|
|
@property
|
|
def window_size(self) -> Tuple[int, int]: ...
|
|
|
|
@property
|
|
def size(self) -> Tuple[int, int]: ...
|
|
|
|
@property
|
|
def viewport_size(self) -> Tuple[int, int]: ...
|
|
|
|
@property
|
|
def viewport_size_with_scrollbar(self) -> Tuple[int, int]: ...
|
|
|
|
def _get_page_rect(self) -> dict: ...
|
|
|
|
def _get_window_rect(self) -> dict: ...
|
|
|
|
|
|
class FrameRect(object):
|
|
def __init__(self, frame: ChromiumFrame):
|
|
self._frame: ChromiumFrame = ...
|
|
|
|
@property
|
|
def location(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def viewport_location(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def screen_location(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def size(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def viewport_size(self) -> Tuple[float, float]: ...
|
|
|
|
@property
|
|
def corners(self) -> Tuple[Tuple[float, float], ...]: ...
|
|
|
|
@property
|
|
def viewport_corners(self) -> Tuple[Tuple[float, float], ...]: ...
|