0
Hello I’m a beginner in programming, and I couldn’t find an explanation of how to solve my problem by searching the net. I am trying to access a spreadsheet file that is in my GDRIVE, through MY MAPS:
# coding=utf-8
from selenium import webdriver
from time import sleep
navegador = webdriver.Chrome()
#Acessar no MyMaps Google
navegador.get("https://www.google.com/intl/pt-BR/maps/about/mymaps/")
navegador.find_element_by_xpath('/html/body/div[3]/div/div/p[2]/a').click()
# Logar na conta
navegador.find_element_by_xpath('//*[@id="identifierId"]').send_keys('xxxxxxxxxxxxxxxxxxxxxxxxxxxx')
navegador.find_element_by_xpath('//*[@id="identifierNext"]/div/button/span').click()
sleep(3)
navegador.find_element_by_xpath('//*[@id="password"]/div[1]/div/div[1]/input').send_keys('xxxxxxxxxxxxxx')
navegador.find_element_by_xpath('//*[@id="passwordNext"]/div/button/span').click()
sleep(3)
# Entrar no mapa
navegador.find_element_by_xpath('//*[@id="docs-editor"]/div[2]/div[2]/div[2]/div/div[3]/div[2]/div[1]/div').click()
sleep(3)
# Carregar a planilha
navegador.find_element_by_xpath('//*[@id="ly0-layerview-import-link"]').click()
sleep(5)
#apertar google drive
navegador.find_element_by_xpath('//*[@id=":7"]/div').click()
But when I implement the attempt to click to access the Gdrive, in the dialog Picker that appears, returns me this error:
Traceback (most recent call last):
File "D:/Curso de Python/Jhony2/Automacao_seleniun.py", line 18, in <module>
navegador.find_element_by_xpath('//*[@id="docs-editor"]/div[2]/div[2]/div[2]/div/div[3]/div[2]/div[1]/div').click()
File "C:\Users\FRANCISCP\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Users\FRANCISCP\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "C:\Users\FRANCISCP\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\FRANCISCP\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":"xpath","selector":"//*[@id="docs-editor"]/div[2]/div[2]/div[2]/div/div[3]/div[2]/div[1]/div"}
(Session info: chrome=91.0.4472.124)
I imagine I have to enter the Picker dialog, in order to manipulate what is inside it. Someone could help me implement this?