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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GET VALUE FROM HREF IN WEB PAGE

Status
Not open for further replies.

sal21

Programmer
Apr 26, 2004
428
IT
Based this link


how to get only the link value in href item:

<a href="/gi_db_comuni/gi_db_comuni-2023-06-30-3bfd3.zip" class="btn btn-primary btn-lg">Scarica il database dei comuni italiani</a>

or get simly the date of: Ultima data di aggiornamento dei dati: 30/06/2023

in my case is:

 
Seriously? We've demonstrated pulling data from a webpage many times to you.

The following needs a reference to the MS HTML Object Library to be set. And that's all the explanation I have time for.

Code:
[COLOR=blue]Public Sub Sal21()

Dim myHTMLDoc As New HTMLDocument

With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", "[URL unfurl="true"]https://www.gardainformatica.it/database-comuni-italiani#scarica",[/URL] False
    .send
    myHTMLDoc.body.innerHTML = .responseText
End With

MsgBox myHTMLDoc.getElementsByClassName("btn btn-primary btn-lg")(9).nameProp

End Sub[/color]
 
tks as usual strongm!

and for:

or get simly the date of: Ultima data di aggiornamento dei dati: 30/06/2023
 
Code:
[COLOR=blue]Public Sub Sal21()

Dim myHTMLDoc As New HTMLDocument

With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", "[URL unfurl="true"]https://www.gardainformatica.it/database-comuni-italiani#scarica",[/URL] False
    .send
    myHTMLDoc.body.innerHTML = .responseText
End With

MsgBox myHTMLDoc.querySelector("STRONG").innerText
MsgBox myHTMLDoc.getElementsByClassName("btn btn-primary btn-lg")(9).nameProp

End Sub[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top