google-gemini / google-gemini/computer-use-preview
Target page, context or browser has been closed
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 405
- PR merge metrics
- No merged PRs in 30d
Description
When i ran the local playwright cmd, it loads the browser but quits abruptly after loading google.com;
`python main.py --query="Go to Google and type 'Hello World' into the search bar" --env="playwright"`
Exception:
```
Traceback (most recent call last):
File "/Users/ace/dev/tools/browser-use/computer-use-preview/main.py", line 84, in
main()
File "/Users/ace/dev/tools/browser-use/computer-use-preview/main.py", line 73, in main
with env as browser_computer:
^^^
File "/Users/ace/dev/tools/browser-use/computer-use-preview/computers/playwright/playwright.py", line 136, in __exit__
self._context.close()
File "/Users/ace/dev/tools/browser-use/computer-use-preview/.venv/lib/python3.12/site-packages/playwright/sync_api/_generated.py", line 13485, in close
return mapping.from_maybe_impl(self._sync(self._impl_obj.close(reason=reason)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ace/dev/tools/browser-use/computer-use-preview/.venv/lib/python3.12/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
return task.result()
^^^^^^^^^^^^^
File "/Users/ace/dev/tools/browser-use/computer-use-preview/.venv/lib/python3.12/site-packages/playwright/_impl/_browser_context.py", line 599, in close
await self._channel.send("close", {"reason": reason})
File "/Users/ace/dev/tools/browser-use/computer-use-preview/.venv/lib/python3.12/site-packages/playwright/_impl/_connection.py", line 61, in send
return await self._connection.wrap_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ace/dev/tools/browser-use/computer-use-preview/.venv/lib/python3.12/site-packages/playwright/_impl/_connection.py", line 528, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.TargetClosedError: BrowserContext.close: Target page, context or browser has been closed
```
Contributor guide
Assessment
This issue has not been assessed yet.