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

Update to support new chromedriver #7

Open
frakman1 opened this issue Oct 15, 2022 · 0 comments
Open

Update to support new chromedriver #7

frakman1 opened this issue Oct 15, 2022 · 0 comments

Comments

@frakman1
Copy link

frakman1 commented Oct 15, 2022

Ubuntu 18
Python 3.9.14
ChromeDriver 106.0.5249.61 (511755355844955cd3e264779baf0dd38212a4d0-refs/branch-heads/5249@{#569})
Google Chrome 106.0.5249.119

The new chrome driver deprecates many of the functions and the init method for launching the driver.

For example, init now looks like this:

    from selenium.webdriver.chrome.service import Service

    s = Service('/home/frak/git/relisterine/download/latest/chromedriver')
    op = webdriver.ChromeOptions()
    op.add_argument('--headless')
    op.add_argument('--no-sandbox')
    op.add_argument('--disable-dev-shm-usage')
    op.add_argument('--window-size=1000,1000')
    chromedriver = webdriver.Chrome(service=s, options=op)

Also, many of the find_element_by_xxx calls have changed.
E.g.

    email_field = chromedriver.find_element('name','inputEmailHandle')
    password_field = chromedriver.find_element('name','inputPassword')
    sign_in_submit = chromedriver.find_element('class name','accountform-btn')

    title_present = chromedriver.find_elements("postinglist_title")

That last one (postinglist_title) is giving me errors and I was unable to continue.

    **** Sleeping for 1 seconds...
Traceback (most recent call last):
  File "/home/frak/git/relisterine/relisterine3.py", line 156, in <module>
    main()
  File "/home/frak/git/relisterine/relisterine3.py", line 134, in main
    login(email_handle, password)  # uses config_file
  File "/home/frak/git/relisterine/relisterine3.py", line 57, in login
    title_present = chromedriver.find_elements("postinglist_title")
  File "/home/frak/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 889, in find_elements
    return self.execute(Command.FIND_ELEMENTS, {
  File "/home/frak/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/home/frak/.local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator
  (Session info: headless chrome=106.0.5249.119)
Stacktrace:
#0 0x55c05c8e12c3 <unknown>
#1 0x55c05c6ea83a <unknown>
#2 0x55c05c72329b <unknown>
#3 0x55c05c723b61 <unknown>
#4 0x55c05c75bd51 <unknown>
#5 0x55c05c741f6d <unknown>
#6 0x55c05c759a50 <unknown>
#7 0x55c05c741d63 <unknown>
#8 0x55c05c7167e3 <unknown>
#9 0x55c05c717a21 <unknown>
#10 0x55c05c92f18e <unknown>
#11 0x55c05c932622 <unknown>
#12 0x55c05c915aae <unknown>
#13 0x55c05c9332a3 <unknown>
#14 0x55c05c909ecf <unknown>
#15 0x55c05c953588 <unknown>
#16 0x55c05c953706 <unknown>
#17 0x55c05c96d8b2 <unknown>
#18 0x7f40f81836db <unknown>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant