0

It does not seem to work and keeps giving me an error regarding Bluetooth drivers Following is my code:-

from selenium import webdriver
from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

usernameStr = 'putYourUsernameHere'
passwordStr = 'putYourPasswordHere'

browser = webdriver.Chrome()
browser.get(('https://accounts.google.com/ServiceLogin?'
            'service=mail&continue=https://mail.google'
            '.com/mail/#identifier'))

# fill in username and hit the next button

username = browser.find_element_by_id('Email')
username.send_keys(usernameStr)

nextButton = browser.find_element_by_id('next')
nextButton.click()

# wait for transition then continue to fill items

password = WebDriverWait(browser, 10).until(
    EC.presence_of_element_located((By.ID, "Passwd")))

password.send_keys(passwordStr)

signInButton = browser.find_element_by_id('signIn')
signInButton.click()

This is the error of my code:-

[11092:17164:0603/171812.746:ERROR:device_event_log_impl.cc(208)] [17:18:12.747] Bluetooth: bluetooth_adapter_winrt.cc:723 GetBluetoothAdapterStaticsActivationFactory failed: Class not registered (0x80040154)

Traceback (most recent call last): File "e:/python.py", line 62, in username = browser.find_element_by_id('Email') File "C:\Users\Bhaskar\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 360, in find_element_by_id return self.find_element(by=By.ID, value=id_) File "C:\Users\Bhaskar\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element 'value': value})['value'] File "C:\Users\Bhaskar\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\Bhaskar\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="Email"]"} (Session info: chrome=83.0.4103.61)

2 Answers 2

0

The username box doesn't have the id 'Email', but 'identifierId'. The same goes for the 'next' button.

Try something like this (might work a bit different for you, since I have Google in a different language).

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

usernameStr = 'putYourUsernameHere'
passwordStr = 'putYourPasswordHere'

browser = webdriver.Chrome()
browser.get(('https://accounts.google.com/ServiceLogin?'
            'service=mail&continue=https://mail.google'
            '.com/mail/#identifier'))

# fill in username and hit the next button

username = browser.find_element_by_id('identifierId')
username.send_keys(usernameStr)

nextButton = browser.find_element_by_xpath('//*[@id="identifierNext"]/span/span')
nextButton.click()

After this, Google blocks my attempts...

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

1 Comment

Google is blocking my attempt as well. The thing which I am trying to accomplish it to use this login form to automate Tinder login, and I'd like to use Google login for this case. In the Tinder bot login, id doesn't even detect the identifierId on login page.
0

id = identifierId

ID you are looking for is "identifierId". try with that.

Comments

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.