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
While using botright in an automation script with playwright, I encountered the following error when trying to open a browser with botright_client.new_browser():
Traceback (most recent call last):
File "playwright5.0.py", line 300, in <module>
asyncio.run(download_pdfs())
File "C:\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
File "C:\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "C:\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
return future.result()
File "playwright5.0.py", line 97, in download_pdfs
browser = await botright_client.new_browser()
File "C:\botright\botright.py", line 147, in new_browser
_proxy: ProxyManager = await ProxyManager(self, proxy)
File "C:\botright\modules\proxy_manager.py", line 45, in __ainit__
link(self, botright)
File "C:\botright\async_class.py", line 221, in link
who._async_class_task_store = where.__tasks__.get_child()
File "C:\botright\async_class.py", line 148, in __tasks__
return self._async_class_task_store
AttributeError: 'Botright' object has no attribute '_async_class_task_store'
Steps to Reproduce:
Install dependencies with pip install botright playwright
Run the following script:
import asyncio
from botright import Botright
async def download_pdfs():
async with Botright(headless=True) as botright_client:
browser = await botright_client.new_browser()
page = await browser.new_page()
await page.goto("https://example.com")
print(await page.title())
await browser.close()
if __name__ == '__main__':
asyncio.run(download_pdfs())
The error occurs when attempting to launch the browser.
Expected Behavior:
The browser should open in headless mode, navigate to the provided URL, and close without any errors.
Environment:
It seems the issue is related to the initialization of the _async_class_task_store attribute in the Botright class. This attribute may not be properly initialized during the browser launch process.
Solutions Tried:
I followed the official documentation and reinstalled all dependencies in a fresh environment, but the issue persists.
Additional Comments:
This issue seems to be connected with how async_class is integrated into the flow of botright. I would appreciate any guidance on how to resolve this, or if a future update might address this behavior.
The text was updated successfully, but these errors were encountered:
While using botright in an automation script with playwright, I encountered the following error when trying to open a browser with botright_client.new_browser():
Steps to Reproduce:
The error occurs when attempting to launch the browser.
Expected Behavior:
The browser should open in headless mode, navigate to the provided URL, and close without any errors.
Environment:
Possible Cause:
It seems the issue is related to the initialization of the _async_class_task_store attribute in the Botright class. This attribute may not be properly initialized during the browser launch process.
Solutions Tried:
I followed the official documentation and reinstalled all dependencies in a fresh environment, but the issue persists.
Additional Comments:
This issue seems to be connected with how async_class is integrated into the flow of botright. I would appreciate any guidance on how to resolve this, or if a future update might address this behavior.
The text was updated successfully, but these errors were encountered: