mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复小问题
This commit is contained in:
parent
bc9bc71777
commit
b8ccbb1adc
@ -694,7 +694,7 @@ class ChromiumBase(BasePage):
|
|||||||
if loc_ind_ele == 0:
|
if loc_ind_ele == 0:
|
||||||
loc_ind_ele = 1
|
loc_ind_ele = 1
|
||||||
elif loc_ind_ele < 0:
|
elif loc_ind_ele < 0:
|
||||||
loc_ind_ele = f'last()-{-loc_ind_ele}'
|
loc_ind_ele = f'last()+{loc_ind_ele}+1'
|
||||||
xpath = f'xpath:(//*[name()="frame" or name()="iframe"])[{loc_ind_ele}]'
|
xpath = f'xpath:(//*[name()="frame" or name()="iframe"])[{loc_ind_ele}]'
|
||||||
r = self._ele(xpath, timeout=timeout)
|
r = self._ele(xpath, timeout=timeout)
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class ChromiumFrame(ChromiumBase):
|
|||||||
self.doc_ele = ChromiumElement(self, obj_id=obj_id)
|
self.doc_ele = ChromiumElement(self, obj_id=obj_id)
|
||||||
|
|
||||||
self._rect = None
|
self._rect = None
|
||||||
end_time = perf_counter() + 5
|
end_time = perf_counter() + 2
|
||||||
while perf_counter() < end_time:
|
while perf_counter() < end_time:
|
||||||
if self.url not in (None, 'about:blank'):
|
if self.url not in (None, 'about:blank'):
|
||||||
break
|
break
|
||||||
|
@ -148,7 +148,7 @@ class ChromiumPage(ChromiumBase):
|
|||||||
if isinstance(id_or_num, str):
|
if isinstance(id_or_num, str):
|
||||||
return ChromiumTab(self, id_or_num)
|
return ChromiumTab(self, id_or_num)
|
||||||
elif isinstance(id_or_num, int):
|
elif isinstance(id_or_num, int):
|
||||||
return ChromiumTab(self, self.tabs[id_or_num - 1 if id_or_num < 0 else id_or_num])
|
return ChromiumTab(self, self.tabs[id_or_num - 1 if id_or_num > 0 else id_or_num])
|
||||||
elif id_or_num is None:
|
elif id_or_num is None:
|
||||||
return ChromiumTab(self, self.tab_id)
|
return ChromiumTab(self, self.tab_id)
|
||||||
elif isinstance(id_or_num, ChromiumTab):
|
elif isinstance(id_or_num, ChromiumTab):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user