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
My Environment:
OS: Windows 11
Python: 3.13.0
I have successfully run the following commands:
pip install crawl4ai
crawl4ai-setup # Setup the browser
Playwright was automatically installed in the directory D:\ProgramData\PLAYWRIGHT_BROWSERS, and I have also set the system environment variable PLAYWRIGHT_BROWSERS_PATH. However, when I run the sample code, I receive the following error:
playwright._impl._errors.Error: BrowserType.launch: Chromium distribution 'chrome' is not found at C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe
Run "playwright install chrome"
The official sample code I ran is as follows:
import asyncio
from crawl4ai import AsyncWebCrawler
async def main():
# Create an instance of AsyncWebCrawler
async with AsyncWebCrawler(verbose=True) as crawler:
# Run the crawler on a URL
result = await crawler.arun(url="https://www.bing.com")
# Print the extracted content
print(result.markdown)
# Run the async main function
asyncio.run(main())
The text was updated successfully, but these errors were encountered:
@keyiis I am a Mac user, and I will try your situation on a Windows machine. In the meantime, try the following steps and let me know how it goes.
1/ First, run the Playwright install command to install the required browser:
playwright install chromium
2/ Then modify your code to explicitly use Playwright's bundled Chromium instead of system Chrome:
importasynciofromcrawl4aiimportAsyncWebCrawlerfromcrawl4ai.async_configsimportBrowserConfigasyncdefmain():
# Create browser config to use bundled Chromiumbrowser_config=BrowserConfig(
browser_type="chromium", # Use Playwright's bundled Chromiumchrome_channel=None# Don't try to use system Chrome
)
# Create crawler instance with the configasyncwithAsyncWebCrawler(browser_config=browser_config, verbose=True) ascrawler:
# Run the crawler on a URLresult=awaitcrawler.arun(url="https://www.bing.com")
# Print the extracted contentprint(result.markdown)
# Run the async main functionasyncio.run(main())
Alternative Solution: If you prefer to use your system's Chrome browser, you can install Chrome and make sure it's in the default installation path. However, I recommend using the bundled Chromium approach above as it's more reliable across different environments.
My Environment:
OS: Windows 11
Python: 3.13.0
I have successfully run the following commands:
Playwright was automatically installed in the directory D:\ProgramData\PLAYWRIGHT_BROWSERS, and I have also set the system environment variable PLAYWRIGHT_BROWSERS_PATH. However, when I run the sample code, I receive the following error:
The official sample code I ran is as follows:
The text was updated successfully, but these errors were encountered: