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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,224,816
Messages
6,181,138
Members
453,021
Latest member
Justyna P

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