Access Site By Loggin

Asked

Viewed 516 times

0

I am not able to access this site below because I can not locate by VBA a way to enter the Login and password. Would anyone know how to access these fields inserir a descrição da imagem aqui

https://www.newspace.com.br/pan/

I tried to access searching for frames, but still could not access

1 answer

3


Try the following code:

Private Sub AcessarSite()
    Dim driver As InternetExplorer
    Dim elem As HTMLBaseElement
    Dim url As String

    url = "https://www.newspace.com.br/pan/"

    Set driver = New InternetExplorer
    driver.Visible = True
    driver.Navigate url

 Set doc = driver.document.frames
 Set doc1 = doc.frames("Principal")

    doc1.document.getElementById("Usuario").innerText = "USUARIO CORRETO"
    doc1.document.getElementById("Senha").innerText = "SENHA CORRETA"
    doc1.document.getElementById("Ok").Click

    Set driver = Nothing
End Sub

I tested here and it worked, the problem was really with the frames.

  • Good morning Marcelo, thank you very much for the response and dedication to the theme, unfortunately I am not able to set the login on the site, it gives me an error -> "Error at runtime '91': The variable of the object or the variable of the block 'With' was not defined". i tried to use the code with Xpath "//*[@id='Usuario']" and with "html/body/form#f/table/tbody/tr/td/iframe/html/body/form#f/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td/input#Usuario" but both return the same error

  • also does not run, it gives as "Error at runtime '424': The object is required", it seems that to access this field I would have to access some iframe, but even trying to access these iframes it still does not locate the login field

  • Instead of ie, try driver, sometimes it is giving error by assuming ie as internet explorer and not a variable

  • I’m sorry Marcelo, but I don’t quite understand what you said.

  • see the edited response

  • Perfect Marcelo, thank you very much my friend, I was already going crazy with it. Let’s go to other challenges now... vlw

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.