Authenticate credentials in a web page popup using Selenium with a Chrome controller and VBA.

purinqui

New Member
Joined
Nov 30, 2019
Messages
29
Office Version
  1. 2019
Platform
  1. Windows
Hello community, i have a trouble to authenticate my credentials using selenium with a chrome driver and VBA.
I need to download a file from a webpage which need user put its credentials.
I read something about it, and i could got this code:

VBA Code:
Sub test()
 
Set ch = New Selenium.ChromeDriver
ch.AddArgument "start-maximized"  Maximize browser screen
ch.Get ("http://gremio:@Dialer2022@https://www.dialer.com.ar/lista/archivos/Lista_Gremio_Dialer.xlsx")
 
End Sub

When I run the code, I get a web page access error:

AAA.png


Error code:
dd.png




The link and the page works fine, for example if i put only the webpage : https://www.dialer.com.ar/lista/archivos/Lista_Gremio_Dialer.xlsx

i can get in on the webpage with the pop up to put credentials:

bb.png

and then when I enter the username and password, the file starts downloading:

cc.png





But i need automatize the download routine with selenium and VBA.
For example if i try with another page with the same code, works fine.

VBA Code:
Sub test()
 
Set ch = New Selenium.ChromeDriver
ch.AddArgument "start-maximized" ' Maximize browser screen
ch.Get ("http://test:test@browserspy.dk/password-ok.php")

End Sub

I think the problem is about the pop up that appears on the page or something in the code that is missing.
I really appreciate some kind of help, thank you very much.
 

Attachments

  • a.PNG
    a.PNG
    8.7 KB · Views: 41

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top