Select a value from a drop down list on the web (HTML) with VBA

Juan Fonseca

New Member
Joined
Apr 4, 2021
Messages
3
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
  2. Web
Kind regards, I am trying to automate a process to upload information from an excel to a web page.

I have already managed to upload all the information looking for the IDs, Classes, Tag, Names as appropriate (searching the page for each section and using .getElementById, .getElementsByTagName, .getElementsByName, etc ... (this part is clear to me)) , but I get to the drop-down list and I don't know how to select one of its options.

1617555208529.png

Specifically, I want to change that option "Vigente" to "Terminado".


I appreciate who can guide me, thank you very much for your attention.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Something like this.

VBA Code:
Sub TestDD()
Dim IE As Object: Set IE = CreateObject("InternetExplorer.Application")
Dim dd As Object

With IE
    .navigate "https://www.seleniumeasy.com/test/basic-select-dropdown-demo.html"
    Set dd = .document.getelementbyID("select-demo")
    Debug.Print dd.Children(1).innertext
End With
End Sub
 
Upvote 0
Your answer was according to my undertanding of the web scrapping knowlage, don't worry, it wasn't neccesary a code example.

Thanks, for your help. This "Children" option apply if i have a class or a tag instead of the ID?.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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