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!

looping data in html table

Status
Not open for further replies.
Why don't you just ask the web site owner for the direct data instead of scraping/stealing it?

 
First step...
Code:
 Sub Scrape()
    
    Dim Browser As InternetExplorer, Document As HTMLDocument, Elements
    Dim Element As IHTMLElement, DOC, I%, R As Range
    Set R = [a2]
    Set Browser = New InternetExplorer
    Browser.Visible = True
    Browser.navigate "[URL unfurl="true"]https://www.codiceinverso.it/elenco-codici-catastali.html"[/URL]
    Do While Browser.Busy And Not Browser.readyState = READYSTATE_COMPLETE
        DoEvents
    Loop
    Set DOC = Browser.Document
    Set Elements = DOC.getElementsByTagName("a")
    For I = 0 To Elements.Length - 1
        Debug.Print Elements(I).textContent
        If Elements(I).textContent = "li" Then
            MsgBox "found"
            Elements(I).Click
        End If
    Next
    MsgBox Elements.Length, , "elements"
    
End Sub

but i dont find the Elements(I).Click
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top