GET DATA from html table

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

GET DATA from html table

Post by sal21 »

based this link how to get:

ABBATANTUONO GIUSEPPE
ABBINANTE NICOLA
....
ecc
Last edited by sal21 on 21 Jan 2022, 07:16, edited 1 time in total.

User avatar
SpeakEasy
4StarLounger
Posts: 536
Joined: 27 Jun 2021, 10:46

Re: GET DATA from html table

Post by SpeakEasy »

Here is an example. NOT production code.

Code: Select all

Option Explicit

'Requires reference to Microsoft HTML Object Library
Public Sub myDoc()
    Dim myBaseDoc As New HTMLDocument
    Dim myDoc As HTMLDocument
    Dim lp As Long
    
    Dim LastNames As Object
    Dim FirstNames As Object
    
    myBaseDoc.Open "<link removed at OP's request>"
    
    Set myDoc = myBaseDoc.createDocumentFromUrl("<link removed at OP's request>", "")
    DoEvents ' cheap, inefficient. often unreliable way to allow page to complete loading
    Set FirstNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_firstname")
    Set LastNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_lastname")
    
    For lp = 0 To FirstNames.Length - 1
        Debug.Print FirstNames(lp).textContent, LastNames(lp).textContent
    Next
End Sub
Last edited by SpeakEasy on 21 Jan 2022, 14:03, edited 2 times in total.

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: GET DATA from html table

Post by sal21 »

SpeakEasy wrote:
10 Jan 2022, 15:13
Here is an example. NOT production code.

Code: Select all

Option Explicit

'Requires reference to Microsoft HTML Object Library
Public Sub myDoc()
    Dim myBaseDoc As New HTMLDocument
    Dim myDoc As HTMLDocument
    Dim lp As Long
    
    Dim LastNames As Object
    Dim FirstNames As Object
    
    myBaseDoc.Open "
    
    Set myDoc = myBaseDoc.createDocumentFromUrl("limit=20&limitstart=0", "")
    DoEvents ' cheap, inefficient. often unreliable way to allow page to complete loading
    Set FirstNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_firstname")
    Set LastNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_lastname")
    
    For lp = 0 To FirstNames.Length - 1
        Debug.Print FirstNames(lp).textContent, LastNames(lp).textContent
    Next
End Sub
tks!
Last edited by sal21 on 21 Jan 2022, 07:17, edited 1 time in total.

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: GET DATA from html table

Post by sal21 »

I have see you have a good erxperince on html DOM...
insert value in html combobox and click

based the link:



how to insert value from MyVar="LIVORNO" in combobox (collegio), and click on button "cerca geometri"

tks.

Sorry but really urgent.
Last edited by sal21 on 21 Jan 2022, 07:16, edited 1 time in total.

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: GET DATA from html table

Post by sal21 »

SpeakEasy wrote:
10 Jan 2022, 15:13
Here is an example. NOT production code.

Code: Select all

Option Explicit

'Requires reference to Microsoft HTML Object Library
Public Sub myDoc()
    Dim myBaseDoc As New HTMLDocument
    Dim myDoc As HTMLDocument
    Dim lp As Long
    
    Dim LastNames As Object
    Dim FirstNames As Object
    
    myBaseDoc.Open "h
    
    Set myDoc = myBaseDoc.createDocumentFromUrl("https://i?limit=20&limitstart=0", "")
    DoEvents ' cheap, inefficient. often unreliable way to allow page to complete loading
    Set FirstNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_firstname")
    Set LastNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_lastname")
    
    For lp = 0 To FirstNames.Length - 1
        Debug.Print FirstNames(lp).textContent, LastNames(lp).textContent
    Next
End Sub
tks!

I have see you have a good erxperince on html DOM...
insert value in html combobox and click

based the link:



how to insert value from MyVar="LIVORNO" in combobox (collegio), and click on button "cerca geometri"

tks.

Sorry but really urgent.
Last edited by sal21 on 03 Feb 2022, 17:38, edited 1 time in total.

User avatar
sal21
PlatinumLounger
Posts: 4334
Joined: 26 Apr 2010, 17:36

Re: GET DATA from html table

Post by sal21 »

SpeakEasy wrote:
10 Jan 2022, 15:13
Here is an example. NOT production code.

Code: Select all

Option Explicit

'Requires reference to Microsoft HTML Object Library
Public Sub myDoc()
    Dim myBaseDoc As New HTMLDocument
    Dim myDoc As HTMLDocument
    Dim lp As Long
    
    Dim LastNames As Object
    Dim FirstNames As Object
    
    myBaseDoc.Open "https://b"
    
    Set myDoc = myBaseDoc.createDocumentFromUrl("httplimit=20&limitstart=0", "")
    DoEvents ' cheap, inefficient. often unreliable way to allow page to complete loading
    Set FirstNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_firstname")
    Set LastNames = myDoc.getElementsByClassName("cbListFieldCont cbUserListFC_lastname")
    
    For lp = 0 To FirstNames.Length - 1
        Debug.Print FirstNames(lp).textContent, LastNames(lp).textContent
    Next
End Sub
please delete the link of site. tks