litlmike Posted May 26, 2006 Share Posted May 26, 2006 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.phpThe 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. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 30, 2006 Moderators Share Posted May 30, 2006 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) Link to comment Share on other sites More sharing options...
litlmike Posted May 30, 2006 Author Share Posted May 30, 2006 (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 May 30, 2006 by litlmike _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now