Closed rubslopes closed 3 months ago
Running playwright install chromium
or playwright install firefox
does nothing, I believe they are both installed.
Running playwright install chromium --dry-run
returns:
playwright install firefox --dry-run
browser: firefox version 123.0
Install location: /Users/rubenslopes/Library/Caches/ms-playwright/firefox-1440
Download url: https://playwright.azureedge.net/builds/firefox/1440/firefox-mac-13-arm64.zip
Download fallback 1: https://playwright-akamai.azureedge.net/builds/firefox/1440/firefox-mac-13-arm64.zip
Download fallback 2: https://playwright-verizon.azureedge.net/builds/firefox/1440/firefox-mac-13-arm64.zip
Maybe it is running playwright.sh install chromium --dry-run
when it should not have the .sh
?
The same error over here, I'm investigating what it could be because this error only occurs on the Linux version. When I run the Playwright script manually, no error occurs, so the file exists, but there's some internal conflict causing this.
You can stop auto install
creator = Create(session=your_session_name, browser='chrome'، install=False)
Well now the symptom has changed, logs:
Exception in thread Thread-1 (thread_worker): Traceback (most recent call last): File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/usr/lib/python3.11/threading.py", line 975, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.11/dist-packages/PlaywrightSafeThread/browser/threadsafe_browser.py", line 270, in __thread_worker self.loop.run_until_complete(self.start_playwright()) File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/PlaywrightSafeThread/browser/threadsafe_browser.py", line 338, in __start_playwright self.context = await self.browser_type.launch_persistent_context(**self._browser_persistent_option) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/.local/lib/python3.11/site-packages/playwright/async_api/_generated.py", line 15075, in launch_persistent_context await self._impl_obj.launch_persistent_context( File "/home/ubuntu/.local/lib/python3.11/site-packages/playwright/_impl/_browser_type.py", line 157, in launch_persistent_context from_channel(await self._channel.send("launchPersistentContext", params)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ File "/home/ubuntu/.local/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 63, in send return await self._connection.wrap_api_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/.local/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 495, in wrap_api_call return await cb() ^^^^^^^^^^ File "/home/ubuntu/.local/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 101, in inner_send result = next(iter(done)).result() ^^^^^^^^^^^^^^^^^^^^^^^^^ playwright._impl._errors.Error: Executable doesn't exist at /tmp/PLAYWRIGHT_BROWSERS_PATH/firefox-1438/firefox/firefox
Please try check_is_install and send when work fine
I think path file break down,
like /tmp/PLAYWRIGHT_BROWSERS_PATH/firefox-1438/firefox/firefox
check if path is exist
There are several folders in tmp, and I believe that "PLAYWRIGHT_BROWSERS_PATH" is just a variable to be replaced to choose the specific browser for that session, as there are several folders with various browsers in /tmp/.
From what I analyzed, the code is correct, I believe there is some incompatibility with the Ubuntu version on my server, I will reset the server settings tomorrow and try to do a clean installation
Thank you guys for your effort into this!
I managed to find a temporary fix:
Running playwright install chromium --dry-run
returns this, as I mentioned earlier:
browser: firefox version 123.0
Install location: /Users/rubenslopes/Library/Caches/ms-playwright/firefox-1440
Download url: https://playwright.azureedge.net/builds/firefox/1440/firefox-mac-13-arm64.zip
Download fallback 1: https://playwright-akamai.azureedge.net/builds/firefox/1440/firefox-mac-13-arm64.zip
Download fallback 2: https://playwright-verizon.azureedge.net/builds/firefox/1440/firefox-mac-13-arm64.zip
So I used the install location as the executable_path
inside the Creator call:
creator = Create(session=your_session_name, browser='firefox', install=False, executable_path='/Users/rubenslopes/Library/Caches/ms-playwright/firefox-1440/firefox/Nightly.app/Contents/MacOS/firefox', headless=False)
temporary fix: (you don't need change executable_path
with every browser)
creator = Create(session=your_session_name, browser='firefox', install=False, PLAYWRIGHT_BROWSERS_PATH='/Users/rubenslopes/Library/Caches/ms-playwright', headless=False)
OR
Update PlaywrightSafeThread pip install PlaywrightSafeThread -U
and use playwright_path_env=False
to not change default path
creator = Create(session=your_session_name, browser='firefox', install=False, playwright_path_env=False, headless=False)
now it is working 100%
My code:
The error:
I'm running WPP_Whatsapp version 0.2.2 on MacOS. I'm running it on a conda env. This also happens if I choose firefox instead of chrome.