diff options
author | Irmius <67007713+Irmius@users.noreply.github.com> | 2023-04-27 20:32:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 19:32:31 +0200 |
commit | 6b4ad1f933dee86dfc272ee6b7d1e43826c6cffb (patch) | |
tree | fbc9407f99f14c47dc2242dcf6d3feef944dab14 | |
parent | Fix imports, type hints and fixtures for goal oriented tests (#3415) (diff) | |
download | Auto-GPT-6b4ad1f933dee86dfc272ee6b7d1e43826c6cffb.tar.gz Auto-GPT-6b4ad1f933dee86dfc272ee6b7d1e43826c6cffb.tar.bz2 Auto-GPT-6b4ad1f933dee86dfc272ee6b7d1e43826c6cffb.zip |
Fix `browse_website` headless mode for Firefox (#2816)
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
-rw-r--r-- | autogpt/commands/web_selenium.py | 5 | ||||
-rw-r--r-- | docs/setup.md | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.py index b435660c0..739520ecd 100644 --- a/autogpt/commands/web_selenium.py +++ b/autogpt/commands/web_selenium.py @@ -78,6 +78,9 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]: ) if CFG.selenium_web_browser == "firefox": + if CFG.selenium_headless: + options.headless = True + options.add_argument("--disable-gpu") driver = webdriver.Firefox( executable_path=GeckoDriverManager().install(), options=options ) @@ -92,7 +95,7 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]: options.add_argument("--no-sandbox") if CFG.selenium_headless: - options.add_argument("--headless") + options.add_argument("--headless=new") options.add_argument("--disable-gpu") chromium_driver_path = Path("/usr/bin/chromedriver") diff --git a/docs/setup.md b/docs/setup.md index 7cbab43df..d0917c8bf 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -64,6 +64,10 @@ Get your OpenAI API key from: [https://platform.openai.com/account/api-keys](htt templates in the [repository]. 6. Continue to [Run with Docker](#run-with-docker) +!!! note "Docker only supports headless browsing" + Auto-GPT uses a browser in headless mode by default: `HEADLESS_BROWSER=True`. + Please do not change this setting in combination with Docker, or Auto-GPT will crash. + [Docker Hub]: https://hub.docker.com/r/significantgravitas/auto-gpt [repository]: https://github.com/Significant-Gravitas/Auto-GPT |