Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for running Chrome in Headless mode. #1473

Merged
merged 3 commits into from
Apr 18, 2023

Conversation

ickma
Copy link

@ickma ickma commented Apr 15, 2023

Add headless mode support for Chrome

Background

To enable Chrome headless support and make it runnable on the server. Currently, our Selenium script has no headless mode, which is causing issues on server

Changes

  • Adds a new configuration parameter headless_browser that can be set in the environment configuration file.
  • If headless_browser is set to true, this updates Selenium to launch the browser in headless mode with the appropriate options.
  • Updates the env template to include the new headless_browser parameter.

Documentation

Test Plan

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

Add headless mode support for Chrome and refactor web page text extraction
@mrjdomingus
Copy link

To prevent the "DevToolsActivePort file doesn't exist" error, you may also want to add this option in web.py:
options.add_argument('--disable-dev-shm-usage')
according to https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t

@nponeccop
Copy link
Contributor

@ickma There are conflicts now

p-i-
p-i- previously approved these changes Apr 16, 2023
@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 17, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@Pwuts Pwuts added function: browse bug Something isn't working labels Apr 18, 2023
@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Apr 18, 2023
@github-actions
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@Pwuts Pwuts mentioned this pull request Apr 18, 2023
5 tasks
@Pwuts Pwuts linked an issue Apr 18, 2023 that may be closed by this pull request
2 tasks
@Pwuts Pwuts force-pushed the support-headless-chrome-mode branch from b268c2d to d6b1aa6 Compare April 18, 2023 18:41
@Pwuts Pwuts linked an issue Apr 18, 2023 that may be closed by this pull request
1 task
Copy link
Member

@Pwuts Pwuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work on both Windows and Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working function: browse
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

browse_website fails without --headless flag browse_website fails with non-headless browser
6 participants