1

I just started my first project with selenium using python. My first task is to login to chrome using 'Sign to chrome' button, but I just can't click it: Sign to chrome button

Button HTML:

<paper-button class="action-button" role="button" tabindex="0" animated="" aria-disabled="false" elevation="0">
                  Sign in to Chrome
                </paper-button>

This is the link: chrome://settings/people

I've tried:

driver = webdriver.Chrome()
driver.find_element_by_class_name('action-button').click()
driver.find_element_by_xpath('//paper-button[@class='action-button']').click()
driver.find_element_by_css_selector('paper-button.action-button').click()

Nothing worked.

Error:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"paper-button:not([raised]).action-button"}
2
  • adding screenshot is bad practice instead you can add html snip of that element also add error stacktrace Commented Jan 21, 2019 at 15:54
  • 1
    @Dev Yep, your'e right. first message here, here to learn. just edited it, let me know if its better now Commented Jan 21, 2019 at 20:38

1 Answer 1

1

Please try to use AutoIt pip and you can try below code:

Install Autoit:

pip install -U pyautoit 

Use below code:

from selenium import webdriver
import autoit
driver = webdriver.Chrome()
driver.get("chrome://settings/")
autoit.send('{TAB}{TAB}{ENTER}')

let me know if it works.

Sign up to request clarification or add additional context in comments.

3 Comments

Thats awesome, ill give it a try. but just so ill know - how can catch that button using only selenium?
Thanks, let me know if it works I will try to fine pure selenium code soon.
@Benjamin Found some reference and it looks it's not possible this url might give you details: stackoverflow.com/a/26473101/8148899

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.