You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async def find_all(
self,
text: str,
timeout: Union[int, float] = 10,
) -> List[nodriver.Element]:
"""
find multiple elements by text
can also be used to wait for such element to appear.
:param text: text to search for. note: script contents are also considered text
:type text: str
:param timeout: raise timeout exception when after this many seconds nothing is found.
:type timeout: float,int
"""
loop = asyncio.get_running_loop()
now = loop.time()
text = text.strip()
items = await self.find_elements_by_text(text)
while not items:
await self
results = await self.find_elements_by_text(text)
if loop.time() - now > timeout:
raise asyncio.TimeoutError(
"time ran out while waiting for text: %s" % text
)
await self.sleep(0.5)
return items
fixed:
async def find_all(
self,
text: str,
timeout: Union[int, float] = 10,
) -> List[nodriver.Element]:
"""
find multiple elements by text
can also be used to wait for such element to appear.
:param text: text to search for. note: script contents are also considered text
:type text: str
:param timeout: raise timeout exception when after this many seconds nothing is found.
:type timeout: float,int
"""
loop = asyncio.get_running_loop()
now = loop.time()
text = text.strip()
items = await self.find_elements_by_text(text)
while not items:
await self
items = await self.find_elements_by_text(text)
if loop.time() - now > timeout:
raise asyncio.TimeoutError(
"time ran out while waiting for text: %s" % text
)
await self.sleep(0.5)
return items
The text was updated successfully, but these errors were encountered:
original
fixed:
The text was updated successfully, but these errors were encountered: