From 8cb233ccffe55f29d3b3a4c38ad70b1854deb7c0 Mon Sep 17 00:00:00 2001 From: shenchucheng Date: Tue, 25 Jul 2023 01:48:09 +0800 Subject: [PATCH] update docs for PlaywrightWrapper/SeleniumWrapper --- metagpt/tools/web_browser_engine_playwright.py | 7 ++++--- metagpt/tools/web_browser_engine_selenium.py | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/metagpt/tools/web_browser_engine_playwright.py b/metagpt/tools/web_browser_engine_playwright.py index 5fef7bd1c..ae8644cce 100644 --- a/metagpt/tools/web_browser_engine_playwright.py +++ b/metagpt/tools/web_browser_engine_playwright.py @@ -13,9 +13,10 @@ from metagpt.logs import logger class PlaywrightWrapper: """Wrapper around Playwright. - To use this module, you should have the ``playwright`` Python package installed and ensure - that the required browsers are also installed. You can download the necessary browser binaries - by running the command `playwright install` for the first time. + To use this module, you should have the `playwright` Python package installed and ensure that + the required browsers are also installed. You can install playwright by running the command + `pip install metagpt[playwright]` and download the necessary browser binaries by running the + command `playwright install` for the first time." """ def __init__( diff --git a/metagpt/tools/web_browser_engine_selenium.py b/metagpt/tools/web_browser_engine_selenium.py index f36f2dfbc..bd8a456ea 100644 --- a/metagpt/tools/web_browser_engine_selenium.py +++ b/metagpt/tools/web_browser_engine_selenium.py @@ -17,8 +17,13 @@ from concurrent import futures class SeleniumWrapper: """Wrapper around Selenium. - To use this module, you should have the ``selenium`` Python package installed and ensure - that the required browsers are also installed. + To use this module, you should check the following: + + 1. Run the following command: pip install metagpt[selenium]. + 2. Make sure you have a compatible web browser installed and the appropriate WebDriver set up + for that browser before running. For example, if you have Mozilla Firefox installed on your + computer, you can set the configuration SELENIUM_BROWSER_TYPE to firefox. After that, you + can scrape web pages using the Selenium WebBrowserEngine. """ def __init__(