Skip to content

Commit

Permalink
Merge pull request #2096 from cryptidv/fix-linux-selenium
Browse files Browse the repository at this point in the history
Add Fixes for Selenium Browsing On Linux
  • Loading branch information
richbeales committed Apr 17, 2023
2 parents 935481c + 2c55ff0 commit cd587bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autogpt/commands/web_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import logging
from pathlib import Path
from autogpt.config import Config
from sys import platform

FILE_DIR = Path(__file__).parent.parent
CFG = Config()
Expand Down Expand Up @@ -75,6 +76,9 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]:
# See https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
driver = webdriver.Safari(options=options)
else:
if platform == "linux" or platform == "linux2":
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--remote-debugging-port=9222")
options.add_argument("--no-sandbox")
driver = webdriver.Chrome(
executable_path=ChromeDriverManager().install(), options=options
Expand Down

0 comments on commit cd587bc

Please sign in to comment.