Sign in to follow this  
Followers 0
litlmike

Table from IE.au3 to .xls

3 posts in this topic

How do I transfer data from a Table on a webpage, do an Excel file, using AutoIt?

I have a hard time understanding arrays, and tables written in HTML. With the help of others in the forum, I can read the info in a table to a GUI. But now, I need the info in Excel. I cannot give out the website for security reasons, but it is similar to the table you will see at this link:

http://www.footballoutsiders.com/stats/te.php

The table has 6 colums and can have 0-20 rows. After navigating to the page, I know I need to _IETableGetCollection, but what after that? Do I write it to an array, or what?

Thanks in advance, all help is appreciate.

Share this post


Link to post
Share on other sites



How do I transfer data from a Table on a webpage, do an Excel file, using AutoIt?

I have a hard time understanding arrays, and tables written in HTML. With the help of others in the forum, I can read the info in a table to a GUI. But now, I need the info in Excel. I cannot give out the website for security reasons, but it is similar to the table you will see at this link:

http://www.footballoutsiders.com/stats/te.php

The table has 6 colums and can have 0-20 rows. After navigating to the page, I know I need to _IETableGetCollection, but what after that? Do I write it to an array, or what?

Thanks in advance, all help is appreciate.

This should get you started:

#include <ExcelCOM.au3>
#include <IE.au3>

; Create a hidden browser window, and navigate to a page
$oIE = _IECreate ("http://www.footballoutsiders.com/stats/te.php")

; Get a reference to the third table on the webpage
$oTable = _IETableGetCollection ($oIE, 2)

; Read the table cells into a 2-D array
$XLArray = _IETableWriteToArray ($oTable)

; Close the browser window
_IEQuit ($oIE)

$sFilePath = @ScriptDir & "\temp.xls"

; Create a blank excel file
_XLCreateBlank ($sFilePath)

; Write the array to the excel file
_XLArrayWrite ($XLArray, $sFilePath, 1, 1, 1, 1)

Sleep(3000)

MsgBox(0, "", "The excel file will now close.")

; Close the excel file
_XLExit ($sFilePath)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This should get you started:

Thanks! Wow....what I was trying was sooo much more difficult-I was making it harder than it really is.

Edited by litlmike

Share this post


Link to post
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
Sign in to follow this  
Followers 0