Página 1 de 1

VBA não localiza campo usando selenium chromedriver

Enviado: 04 Ago 2023 às 13:22
por denisonreis
Estou tendo um problema no meus codigo. Acredito que seja porque o site tem um frame.

Será que tenho que mudar alguma coisa no código?

Estou usando selenium chromedriver.





Public navegador As New ChromeDriver

Dim objIE As New InternetExplorer 'Referencie "Microsoft Internet Controls"

Dim GC As Object

Dim WebUrl As String

Dim NavigatorAddress As String





Sub outros_site_nfs_pme_chrome()



Dim url As String

url = http://nfse.eunapolis.ba.gov.br/webrun/ ... rolling=no

IM = Planilha2.Range("D21").Text

CPF = Planilha2.Range("G21").Text

SN = Planilha2.Range("J21").Text



nav_campo1 = Planilha1.Range("J29").Text

nav_campo2 = Planilha1.Range("K29").Text

nav_campo3 = Planilha1.Range("L29").Text

nav_campo4 = Planilha1.Range("M29").Text



navegador.Start

navegador.Window.Maximize

navegador.Get url



navegador.FindElementByXPath(nav_campo1).SendKeys (IM)

navegador.FindElementByXPath(nav_campo2).SendKeys (CPF)



End Sub

Responder