Posts: 97
Threads: 48
Joined: Sep 2010
Hello,
I want to use the data from a HTML table. I tried several things but nothing got me the data or everything is messed up.
The table looks like this:
html_part.txt (Size: 3.82 KB / Downloads: 417)
i need the whole column of data.
a part of the HTML is shown here:
Is there somebody who can help me with this?
Posts: 12,066
Threads: 140
Joined: Dec 2002
Try HtmlDoc class.
Macro
Macro2686
out
HtmlDoc d
d.SetOptions(2)
d.InitFromWeb("http://www.quickmacros.com")
;out d.GetHtml
ARRAY(str) a; d.GetTable(1 a) ;;press F1 on GetTable for more examples
;display text in first cell of each row
int i ncolumns=2
for i 0 a.len ncolumns
,out a[i]
,;out a[i+1] ;;second cell, and so on
,out "---------"
Posts: 97
Threads: 48
Joined: Sep 2010
Well thank you so far! Can you help me with another thing?
How can i get the output like the columns so the data as shown in the columns?
Like i have a table like this :
today | tomorrow
first | last
the output should be today/first & tomorrow/last
Posts: 12,066
Threads: 140
Joined: Dec 2002
Macro
Macro2686
int i ncolumns=2
for i 0 a.len ncolumns
,str f.format("%-20s %-20s" a[i] a[i+1])
,out f
Posts: 97
Threads: 48
Joined: Sep 2010
Thanks again!!
1 final question if i may...
how to split everything so i can use the column seperately? what 1 mean is from my previous sample that the data in the first column and second column can be accessed completely seperate from eachother.
Posts: 12,066
Threads: 140
Joined: Dec 2002
a[i] is first column, a[i+1] is second column. You can copy them to 2 separate arrays if want. If the table contains >2 columns, change ncolumns.