I've been hours searching different ways to login into a web for scraping purposes but I just can't find the way. The last thing I tried is following this topic but still no success....
This is my code:
Option Explicit
Sub DescargaInformes()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim ieTable As Object
Dim clip As DataObject
Dim oHTML_Element As Object
'creamos nueva instancia del IE y vamos a la web
Set ieApp = New InternetExplorer
With ieApp
.Navigate "https://mediamarkt.zendesk.com/access/unauthenticated"
.Visible = True
End With
'esperamos a que la web esté cargada
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
'rellnamos los datos de login y pass
With ieDoc
.getElementById("user_email").Value = "user"
.getElementById("user_password").Value = "pass"
End With
'esperamos a que la web esté cargada
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
End Sub
Can someone point me in the right direction on how to login here?
This is (what I think) the code that show's the user and pass id's:
<div class="credentials">
<label for="user_email">Correo electrónico</label>
<input name="user[email]" id="user_email" autofocus="autofocus" type="email" autocomplete="on">
<label for="user_password">Contraseña</label>
<input name="user[password]" id="user_password" type="password" autocomplete="off">
</div>
Edit: I get the error here .getElementById("user_email").Value = "user" object required.