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