Signed-off-by: g1879 <g1879@qq.com>
This commit is contained in:
g1879 2022-12-13 15:33:28 +00:00 committed by Gitee
parent 830b2258af
commit 55d7e78ef2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -182,8 +182,7 @@ class ChromiumBase(BasePage):
@property @property
def html(self): def html(self):
"""返回当前页面html文本""" """返回当前页面html文本"""
node_id = self._wait_driver.DOM.getDocument()['root']['nodeId'] return self._wait_driver.DOM.getOuterHTML(objectId=self._root_id)['outerHTML']
return self._wait_driver.DOM.getOuterHTML(nodeId=node_id)['outerHTML']
@property @property
def json(self): def json(self):
@ -477,7 +476,7 @@ class ChromiumBase(BasePage):
def stop_loading(self): def stop_loading(self):
"""页面停止加载""" """页面停止加载"""
if self._debug: if self._debug:
print('止页面加载') print('止页面加载')
self._tab_obj.Page.stopLoading() self._tab_obj.Page.stopLoading()
while self.ready_state != 'complete': while self.ready_state != 'complete':
sleep(.1) sleep(.1)