Skip to content

Commit

Permalink
fixes Significant-Gravitas#1821 by installing required drivers and ad…
Browse files Browse the repository at this point in the history
…ding options to chromedriver
  • Loading branch information
psvensson authored and p-i- committed Apr 16, 2023
1 parent 41a0a68 commit 92ab3e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM python:3.11-slim
# Install git
RUN apt-get -y update
RUN apt-get -y install git
RUN apt-get install -y libglib2.0 libnss3 libgconf-2-4 libfontconfig1 chromium-driver

# Set environment variables
ENV PIP_NO_CACHE_DIR=yes \
Expand All @@ -24,4 +25,4 @@ RUN pip install --no-cache-dir --user -r requirements-docker.txt
COPY --chown=appuser:appuser autogpt/ ./autogpt

# Set the entrypoint
ENTRYPOINT ["python", "-m", "autogpt"]
ENTRYPOINT ["python", "-m", "autogpt", "--debug"]
4 changes: 4 additions & 0 deletions autogpt/commands/web_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ 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:
options.add_argument('--no-sandbox')
options.add_argument('--window-size=1420,1080')
options.add_argument('--headless')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome(
executable_path=ChromeDriverManager().install(), options=options
)
Expand Down

0 comments on commit 92ab3e0

Please sign in to comment.