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

headless chromedriver? #88

Open
anishzute opened this issue May 4, 2020 · 4 comments
Open

headless chromedriver? #88

anishzute opened this issue May 4, 2020 · 4 comments
Labels
feature Feature requests or improvements

Comments

@anishzute
Copy link

Out of curiosity, is there a way to have the authentication method run entirely headless if username and password parameters are passed so that it can be used on things such as servers and google colab without modification?
I have currently modified the auth/init.py to include the following:

    from selenium import webdriver
    options = webdriver.ChromeOptions()
    options.add_argument('--headless')
    options.add_argument('--no-sandbox')
    options.add_argument('--disable-dev-shm-usage')
    chrome_driver_binary = which('chromedriver') or "/usr/lib/chromium-browser/chromedriver"
    driver = webdriver.Chrome('chromedriver', options=options)

however I don't know if this would work on other operating systems and implementations.

@ka05
Copy link

ka05 commented May 5, 2020

@anishzute Im not certain about how the --headless flag is handled on every OS but it seems at least on OSX and Ubuntu It has worked for me. Also I have a PR open that handles automating the entire Auth flow. It will default to a headless selenium instance. See code

@anishzute
Copy link
Author

Nice! I'm currently working on Ubuntu off a forked repo where I've incorporated the headless flag, but it's always a pain to deal with local chromedriver and all that, especially because I tend to do a lot of my quick scripting/prototyping in Google Colab/Jupyter. I'm hoping your auth method gets merged as it seems much more straightforward and it would be nice to have 2 factor support. Regardless, I'll copy over your code and give it a go. Thanks!

@dahifi
Copy link
Collaborator

dahifi commented May 12, 2020

I went ahead and merged into dev branch.

We don't have tests running on that yet. @timkpaine can we update the azure-pipeline.yml to trigger on dev also? Not sure what 2nd order effects that would have.

@timkpaine timkpaine added the feature Feature requests or improvements label Jun 15, 2020
@timkpaine
Copy link
Owner

yep just add it to the list of triggers in the pipelines file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or improvements
Projects
None yet
Development

No branches or pull requests

4 participants