Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTML Table data
#1
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:

.txt   html_part.txt (Size: 3.82 KB / Downloads: 379)

i need the whole column of data.
a part of the HTML is shown here:
   

Is there somebody who can help me with this?
#2
Try HtmlDoc class.

Macro Macro2686
Code:
Copy      Help
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 "---------"
#3
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
#4
Macro Macro2686
Code:
Copy      Help
int i ncolumns=2
for i 0 a.len ncolumns
,str f.format("%-20s %-20s" a[i] a[i+1])
,out f
#5
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.
#6
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)