Jump to content

Trying to write HTML Table to and Array then to clipboard.


gseller
 Share

Recommended Posts

Hey, I was wondering if someone could help me figure this out. I am trying to collect data from HTML Tables and add to an array then send to clipboard. I can't seem to get it right. Any ideas?

#include <IE.au3>
#include <Array.au3>
$oIE = _IE_Example ("table")
$oTable = _IETableGetCollection ($oIE, 1)
$aTableData = _IETableWriteToArray ($oTable, True)
$aSendCodeToClip = _ArrayToClip( $aTableData)
MsgBox( 0, "_ArrayToClip() Test", ClipGet() )

_IEQuit ($oIE)
Link to comment
Share on other sites

Like this maybe?

#include <IE.au3>
#include <Array.au3>

Global $ArrayCont=""

$oIE = _IE_Example ("table")
$oTable = _IETableGetCollection ($oIE, 1)
$aTableData = _IETableWriteToArray ($oTable, True)

$rows = UBound($aTableData)
$cols = UBound($aTableData,2)

For $m=0 to $rows-1
    For $n=0 to $cols-1
            $ArrayCont=$ArrayCont&" | "&$aTableData[$m][$n]
    Next
    $ArrayCont=$ArrayCont&@CRLF 
Next
ClipPut($ArrayCont)
MsgBox(0,"",ClipGet())

_IEQuit ($oIE)

This is what it returns:

| Table Top |  |  | 
 | One | Two |  | 
 | Three | Four | Five | 
 | Six | Seven |  | 
 | Eight | Nine | Ten | Eleven
Link to comment
Share on other sites

Ok I see, so you break it down into rows and columns. I tried everything I could think of and scoured the helpfile and forum and was begining to thing it may be an autoit limitation these two things working together but didn't see the logic in that.. LOL

Thank You!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...