Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13861

error when link is chrome:// dino but works for every other link #2264

$
0
0

System info

  • Playwright Version: [v1.XX]
  • Operating System: [Windows 11 latest]
  • Browser: chrome

Source code

import asyncioimport loggingimport osfrom playwright.async_api import async_playwrightfrom scraper.capt import captfrom dotenv import load_dotenvtotal_tabs = 10link = "chrome://dino/"async def main() -> None:    env_fn = load_dotenv()    logging.basicConfig(        level=logging.INFO,        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',        datefmt='%Y-%m-%d %H:%M:%S',        filename='logs/logs.log'    )    logger = logging.getLogger(__name__)    async with async_playwright() as p:        # browser = await p.chromium.launch(headless=False)        # browser = await p.chromium.launch()        browser = await p.chromium.launch(headless=False, args=['--no-sandbox'])        # context = await browser.new_context()        # context not needed as here using more windows is better than tabs ig since it can be parallel but not sure if tabs can be parallelized        launch = await capt(browser=browser,logger=logger,n=total_tabs,link=link).open_n_tabs()        # await context.close()        await browser.close()        logger.info("---closing browser---")if __name__ == '__main__':    # asyncio.run(main())    asyncio.get_event_loop().run_until_complete(main())
  • [yes ] I provided exact source code that allows reproducing the issue locally.

If the link is for example https://www.google.com/ it works perfectly fine but Im trying to create a reinforcement learning model on dino game so i want to access the chrome://dino link then im getting this error...

PS M:\dino tut> & C:/Users/hp/anaconda3/python.exe "m:/dino tut/main.py"Traceback (most recent call last):  File "m:\dino tut\main.py", line 35, in <module>    asyncio.get_event_loop().run_until_complete(main())  File "C:\Users\hp\anaconda3\Lib\asyncio\base_events.py", line 653, in run_until_complete    return future.result()           ^^^^^^^^^^^^^^^  File "m:\dino tut\main.py", line 26, in main    launch = await capt(browser=browser,logger=logger,n=total_tabs,link=link).open_n_tabs()             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "m:\dino tut\scraper\capt.py", line 19, in open_n_tabs    await page.goto(self.link)  File "C:\Users\hp\anaconda3\Lib\site-packages\playwright\async_api\_generated.py", line 9275, in goto    await self._impl_obj.goto(  File "C:\Users\hp\anaconda3\Lib\site-packages\playwright\_impl\_page.py", line 484, in goto    return await self._main_frame.goto(**locals_to_params(locals()))           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "C:\Users\hp\anaconda3\Lib\site-packages\playwright\_impl\_frame.py", line 149, in goto    await self._channel.send("goto", locals_to_params(locals()))  File "C:\Users\hp\anaconda3\Lib\site-packages\playwright\_impl\_connection.py", line 63, in send    return await self._connection.wrap_api_call(           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "C:\Users\hp\anaconda3\Lib\site-packages\playwright\_impl\_connection.py", line 495, in wrap_api_call    return await cb()           ^^^^^^^^^^  File "C:\Users\hp\anaconda3\Lib\site-packages\playwright\_impl\_connection.py", line 101, in inner_send    result = next(iter(done)).result()             ^^^^^^^^^^^^^^^^^^^^^^^^^playwright._impl._errors.Error: net::ERR_INTERNET_DISCONNECTED at chrome://dino/

what i dont get is why is internet disconnected for only this specific site and not some other issue like unable to access the site


Viewing all articles
Browse latest Browse all 13861

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>