1

I am trying to write a simple Python script that logs in to Gmail(I know it I may violate Gmail terms & conditions, but this is only for testing purpose). I have done proper research on it before posting this question here. but, it still doesn't work. I have watched a video on YouTube and the same code works there, but not in my local machine(I am using Windows 10 on my HP Laptop).

Can you please take a look at the below script and let me know if there's any error in it?

from selenium import webdriver
import time


driver = webdriver.Chrome(r'C:\Users\hp\Downloads\chromedriver.exe')
driver.get('https://accounts.google.com/signin/v2/identifier?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ss=1&scc=1&ltmpl=default&ltmplcache=2&emr=1&osid=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin')

email_field = driver.find_element_by_id('identifierId')
email_field.clear()
email_field.send_keys('My Email ID')

email_field_button = driver.find_element_by_id('identifierNext')
email_field_button.click()
time.sleep(1)


password_field = driver.find_element_by_id('password')
password_field.clear()
password_field.send_keys('My password')

password_field_button = driver.find_element_by_id('passwordNext')
password_field_button.click()
time.sleep(1)

This is the error message I am getting:

Traceback (most recent call last):
  File "gmail_login.py", line 6, in <module>
    driver.get('https://accounts.google.com/signin/v2/identifier?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ss=1&scc=1&ltmpl=default&ltmplcache=2&emr=1&osid=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin')
  File "C:\Users\hp\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 332, in get
[6012:9752:0812/071242.870:ERROR:shader_disk_cache.cc(237)] Failed to create shader cache entry: -2
[6012:9752:0812/071242.962:ERROR:shader_disk_cache.cc(237)] Failed to create shader cache entry: -2
    self.execute(Command.GET, {'url': url})
  File "C:\Users\hp\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "C:\Users\hp\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'
  (Session info: chrome=68.0.3440.106)
  (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.17134 x86_64)
U13-Forward
  • 69,221
  • 14
  • 89
  • 114
Mahendar
  • 11
  • 2

0 Answers0