Beispiel #1
0
 async def goto(self):
     """Navigate to address"""
     user_agent = await self.cloak_navigator()
     await self.page.setUserAgent(user_agent)
     try:
         await self.loop.create_task(
             self.page.goto(
                 self.url,
                 timeout=self.page_load_timeout,
                 waitUntil="domcontentloaded",))
     except asyncio.TimeoutError:
         raise PageError("Page loading timed-out")
     except Exception as exc:
         raise PageError(f"Page raised an error: `{exc}`")
Beispiel #2
0
 async def goto(self, url, regenerate_navigator=False):
     if not self.navigator_config or regenerate_navigator:
         await self.cloak_navigator()
     await self.page.setUserAgent(self.user_agent)
     try:
         await self.loop.create_task(
             self.page.goto(
                 url,
                 timeout=self.timeout,
                 waitUntil='domcontentloaded',))
     except asyncio.TimeoutError:
         raise PageError(f'Timeout loading {url}')
     except Exception as ex:
         raise PageError(f'While loading [{url}] encountered error{ex}')
Beispiel #3
0
 async def goto(self):
     """Navigate to address"""
     user_agent = await self.cloak_navigator()
     await self.page.setUserAgent(user_agent)
     try:
         await self.page.goto(
             self.url,
             timeout=self.page_load_timeout,
             waitUntil="domcontentloaded",
         )
     except asyncio.TimeoutError:
         raise PageError("Problem loading page")