mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-12 12:25:19 +08:00
微调
This commit is contained in:
parent
24e7406fea
commit
e103a6a3e0
@ -76,7 +76,7 @@ class Drission(object):
|
||||
self._driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
|
||||
"source": """
|
||||
Object.defineProperty(navigator, 'webdriver', {
|
||||
get: () => undefined
|
||||
get: () => Chrome
|
||||
})
|
||||
"""
|
||||
})
|
||||
|
@ -30,6 +30,10 @@ class DriverElement(DrissionElement):
|
||||
attrs = [f"{attr}='{self.attrs[attr]}'" for attr in self.attrs]
|
||||
return f'<DriverElement {self.tag} {" ".join(attrs)}>'
|
||||
|
||||
@property
|
||||
def driver(self) -> WebDriver:
|
||||
return self._driver
|
||||
|
||||
@property
|
||||
def attrs(self) -> dict:
|
||||
"""返回元素所有属性及值"""
|
||||
|
@ -1023,6 +1023,10 @@ Parameter Description:
|
||||
|
||||
The wrapped WebElement object.
|
||||
|
||||
### driver
|
||||
|
||||
WebDriver object of the element.
|
||||
|
||||
### attrs
|
||||
|
||||
Return all attributes and values of the elements in a dictionary.
|
||||
|
@ -1020,6 +1020,10 @@ driver模式的元素对象,包装了一个WebElement对象,并封装了常
|
||||
|
||||
被包装的WebElement对象。
|
||||
|
||||
### driver
|
||||
|
||||
操作元素的WebDriver对象。
|
||||
|
||||
### attrs
|
||||
|
||||
以字典方式返回元素所有属性及值。
|
||||
|
Loading…
Reference in New Issue
Block a user