mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复获取同域iframe出错问题
This commit is contained in:
parent
b9bfa1a1bc
commit
74caffc796
@ -11,6 +11,7 @@ from pathlib import Path
|
||||
from re import search
|
||||
from typing import Union, Tuple, List, Any
|
||||
from time import perf_counter, sleep
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from pychrome import Tab
|
||||
from requests import Session
|
||||
@ -1467,6 +1468,11 @@ class ChromiumBase(BasePage):
|
||||
for i in nodeIds['nodeIds']:
|
||||
ele = ChromiumElement(self, node_id=i)
|
||||
if ele.tag in ('iframe', 'frame'):
|
||||
src = ele.attr('src')
|
||||
if src:
|
||||
netloc1 = urlparse(src).netloc
|
||||
netloc2 = urlparse(self.url).netloc
|
||||
if netloc1 != netloc2:
|
||||
ele = ChromiumFrame(self, ele)
|
||||
eles.append(ele)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user