Skip to content

Commit

Permalink
Force language in selenium
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-m committed Mar 29, 2020
1 parent ce04496 commit 5f0a822
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ ENV/
/site

# End of https://www.gitignore.io/api/python,pycharm

geckodriver
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ gecko:
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
mkdir geckodriver
tar -xzf geckodriver-v0.24.0-linux64.tar.gz -C geckodriver
rm geckodriver-v0.24.0-linux64.tar.gz

test:
# nosetests tests -v --with-coverage --cover-package=python_anticaptcha --processes=8
PATH=$$PATH:$$PWD/geckodriver nosetests tests --verbosity=3 --processes=8

clean:
rm -r build
rm -r build geckodriver

lint:
docker run --rm -v /$$(pwd):/apps alpine/flake8 ./
Expand Down
6 changes: 5 additions & 1 deletion examples/recaptcha_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ def get_sitekey(driver):
if __name__ == "__main__":
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
from selenium.webdriver import FirefoxProfile

ffprofile = FirefoxProfile()
ffprofile.set_preference("intl.accept_languages", "ja")

options = Options()
# options.add_argument('-headless')
driver = Firefox(firefox_options=options)
driver = Firefox(firefox_profile=ffprofile, firefox_options=options)
assert "Verification Success... Hooray!" in process(driver)

0 comments on commit 5f0a822

Please sign in to comment.