based this link how to get:
ABBATANTUONO GIUSEPPE
ABBINANTE NICOLA
....
ecc
GET DATA from html table
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
GET DATA from html table
Last edited by sal21 on 21 Jan 2022, 07:16, edited 1 time in total.
-
- 4StarLounger
- Posts: 550
- Joined: 27 Jun 2021, 10:46
Re: GET DATA from html table
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.
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: GET DATA from html table
tks!SpeakEasy wrote: ↑10 Jan 2022, 15:13Here 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
Last edited by sal21 on 21 Jan 2022, 07:17, edited 1 time in total.
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: GET DATA from html table
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.
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.
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: GET DATA from html table
tks!SpeakEasy wrote: ↑10 Jan 2022, 15:13Here 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
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.
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: GET DATA from html table
please delete the link of site. tksSpeakEasy wrote: ↑10 Jan 2022, 15:13Here 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