async def _async_render(self, *, url: str, script: str = None, scrolldown, sleep: int, wait: float, reload, content: Optional[str], timeout: Union[float, int], keep_page: bool):
try:<EOL><INDENT>page = await self.browser.newPage()<EOL>await asyncio.sleep(wait)<EOL>if reload:<EOL><INDENT>await page.goto(url, options={'<STR_LIT>': int(timeout * <NUM_LIT:1000>)})<EOL><DEDENT>else:<EOL><INDENT>await page.goto(f'<STR_LIT>', options={'<STR_LIT>': int(timeout * <NUM_LIT:1000>)})<EOL><DEDENT>result = None<EOL>if script:<EOL><INDENT>result = await page.evaluate(script)<EOL><DEDENT>if scrolldown:<EOL><INDENT>for _ in range(scrolldown):<EOL><INDENT>await page._keyboard.down('<STR_LIT>')<EOL>await asyncio.sleep(sleep)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>await asyncio.sleep(sleep)<EOL><DEDENT>if scrolldown:<EOL><INDENT>await page._keyboard.up('<STR_LIT>')<EOL><DEDENT>content = await page.content()<EOL>if not keep_page:<EOL><INDENT>await page.close()<EOL>page = None<EOL><DEDENT>return content, result, page<EOL><DEDENT>except TimeoutError:<EOL><INDENT>await page.close()<EOL>page = None<EOL>return None<EOL><DEDENT>
Handle page creation and js rendering. Internal use for render/arender methods.