Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get elelmnt in dropdown on web page

Status
Not open for further replies.

2009luca

Programmer
Jul 27, 2013
222
IT
Option Explicit
Sub prova()

Const URL As String = " Dim IE As New InternetExplorer, oHtml As HTMLDocument, post As Object, R&

With IE
.Visible = True
.Navigate URL
Do While .Busy: DoEvents: Loop
While .Busy Or .ReadyState < 4: DoEvents: Wend
Set oHtml = .Document
End With

For Each post In oHtml.getElementsByTagName("OPTION")
Debug.Print post.innerText
Next

End Sub

Based this code(strongm), i get only the part of item of dropdown, for example:


...
Ca'D'andrea (Lombardia)
Cabella Ligure (Piemonte)
Cabiate (Lombardia)
Cabras (Sardegna)
Caccamo (Sicilia)
Caccuri (Calabria)
Cadegliano-viconago (Lombardia)
Cadelbosco di Sopra (Emilia-Romagna)
Cadeo (Emilia-Romagna)
Caderzone Terme (Trentino-Alto Adige)
...

But i need to get also a part of http url, for example:

"/ita/piemonte/baceno.html"
"/ita/campania/bacoli.html"
"/ita/liguria/badalucco.html"
"/ita/sardegna/badesi.html"
...
eccc...
 
TKS bro!

But i dont need the value of first element in dropdown, in my case Selezionare
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top