Jump to content

Table Problems


Recommended Posts

The last 6 lines are were I'm having trouble. This is basically a program to run through my bank account and log deposits and withdrawals to Excel (I've bolded the data in the first cell that I want to extract). However, I'm having trouble finding the table id, or anyway of extracting otherwise. I cut down the source script of the bank website to save space and to hide some data, if there is something I may have left out please let me know.

Thanks.

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

$oIE = _IECreate("www.vcu.com/")
_IELinkClickByText($oIE,"Access Your Accounts")
Send("Account Number{TAB}Password{ENTER}")
_IELoadWait($oIE)
_IENavigate($oIE,"https://secure.vcu.com/asp/USERS/PCU/AccountSummary.asp")
_IENavigate($oIE,"https://secure.vcu.com/asp/USERS/PCU/Draft/DetailMonth.asp?Suffix=9")
MsgBox(0,"select month","then close")
$split = StringSplit($oIEText,"DescriptionAmountBalance",1)
$SplitCount = $split[0]
If $SplitCount = 2 Then
Else
    MsgBox(0,"Split Error","")
    Exit
EndIf
$second = $split[2]
MsgBox(0,"second",$second)
$oTable = _IEGetObjByName($oIE,"Checking 9 Detail")
If @error = 7 Then
    MsgBox(0,"There was no match","")
EndIf
$aTable = _IETableWriteToArray($oTable)
_ArrayDisplay($aTable)

<table bordercolor="#FFFFFF" bgcolor="#FFFFFF" border="0" cellspacing="2" cellpadding="3" width="100%" align="Left">

<tr align="Left" valign="Middle">

<td bgcolor="#96976F" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000"><b><A HREF="/asp/USERS/PCU/Draft/DetailMonth.asp?TPDTCID=AHDRAFTHISTORY&TPCOLUMN=EFFECTIVE&TargetDate=7%2F1%2F2007+to+7%2F31%2F2007&SUFFIX=9&submit=Get+History" STYLE="{color:#000000}">Effective Date</A></b></font></td>

<td bgcolor="#96976F" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000"><b>Transaction Description</b></font></td>

<td bgcolor="#96976F" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000"><b>Amount</b></font></td>

<td bgcolor="#96976F" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000"><b>Balance</b></font></td>

</tr>

<tr align="Left" valign="Middle">

<td bgcolor="#F5F5DC" align="Center" valign="Middle"><font size="2" face="Verdana" color="#000000">06/29/2007</font></td>

<td bgcolor="#F5F5DC" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000">Withdrawal @ QT 64 Trace #027284</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">-$20.01</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$1,109.73</font></td>

</tr>

<tr align="Left" valign="Middle">

<td bgcolor="#F5F5DC" align="Center" valign="Middle"><font size="2" face="Verdana" color="#000000">06/30/2007</font></td>

<td bgcolor="#F5F5DC" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000">Withdrawal @ LOWE'S #75 Trace #028548</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">-$6.42</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$1,103.31</font></td>

</tr>

<tr align="Left" valign="Middle">

<td bgcolor="#F5F5DC" align="Center" valign="Middle"><font size="2" face="Verdana" color="#000000">07/06/2007</font></td>

<td bgcolor="#F5F5DC" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000">Deposit-ACH-A-TGT (REG SALARY)</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$75.00</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$1,178.31</font></td>

</tr>

<tr align="Left" valign="Middle">

<td bgcolor="#F5F5DC" align="Center" valign="Middle"><font size="2" face="Verdana" color="#000000">07/11/2007</font></td>

<td bgcolor="#F5F5DC" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000">Withdrawal @ HARBOR FREIGHT CATALOG 800-444-3353 CA Trace #009470</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">-$12.97</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$1,165.34</font></td>

</tr>

<tr align="Left" valign="Middle">

<td bgcolor="#F5F5DC" align="Center" valign="Middle"><font size="2" face="Verdana" color="#000000">07/18/2007</font></td>

<td bgcolor="#F5F5DC" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000">Withdrawal @ HARBOR FREIGHT CATALOG 800-444-3353 CA Trace #016540</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">-$45.96</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$1,119.38</font></td>

</tr>

<tr align="Left" valign="Middle">

<td bgcolor="#F5F5DC" align="Center" valign="Middle"><font size="2" face="Verdana" color="#000000">07/20/2007</font></td>

<td bgcolor="#F5F5DC" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000">Deposit-ACH-A-TGT (REG SALARY)</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$75.00</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$1,194.38</font></td>

</tr>

<tr align="Left" valign="Middle">

<td bgcolor="#F5F5DC" align="Center" valign="Middle"><font size="2" face="Verdana" color="#000000">07/26/2007</font></td>

<td bgcolor="#F5F5DC" align="Left" valign="Middle"><font size="2" face="Verdana" color="#000000">Withdrawal @ ELECTRONICS GOLDMINE 602-451-7454 AZ Trace #025954</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">-$83.94</font></td>

<td bgcolor="#F5F5DC" align="Right" valign="Middle"><font size="2" face="Verdana" color="#000000">$1,158.98</font></td>

</tr>

</table>

Link to comment
Share on other sites

It is difficult to help as i don't know what exactly the problem is, and i don't have an account at that site to test it with.

Could you perhaps post what you are getting in the _ArrayDisplay() VS. what you are hoping to get?

Link to comment
Share on other sites

Thanks for the reply.

I changed a few things around and got the string to read:

06/29/2007Withdrawal @ QT 643 060064 Trace #027284-$20.01$1,109.73

06/30/2007Withdrawal @ LOWE'S #75Trace #028548-$6.42$1,103.31

07/06/2007Deposit-ACH-A-TGT (REG SALARY)$75.00$1,178.31

07/11/2007Withdrawal @ HARBOR FREIGHT CATALOG 800-444-3353 CA Trace #009470-$12.97$1,165.34

07/18/2007Withdrawal @ HARBOR FREIGHT CATALOG 800-444-3353 CA Trace #016540-$45.96$1,119.38

07/20/2007Deposit-ACH-A-TGT (REG SALARY)$75.00$1,194.38

07/22/2007Withdrawal @ LOWE'S #75Trace #020039-$11.78$1,182.60

07/23/2007Withdrawal @ ADVANCE AUTO PARTS #507Trace #021180-$4.68$1,177.92

07/25/2007Deposit$65.00$1,242.92

07/26/2007Withdrawal @ ELECTRONICS GOLDMINE 602-451-7454 AZ Trace #025954-$83.94$1,158.98

I've used StringSplit before but now I'm wondering if there is and easy way to split the separate lines or reformat without the line breaks.

I'd like them to just be in an indexed array by line.

Thanks again.

Link to comment
Share on other sites

Does this return an object (a table object) for you? $oTable = _IEGetObjByName($oIE,"Checking 9 Detail")

I do not see anything with that name in the HTML you posted. I would typically use _IETableGetCollection($,IE, index) where index is a zero-based index of the table numbered as the tables appear on the page...

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

So you do or don't want the individual values?

If you do want them, then string split is definitely the way to go, otherwise, you already have them indexed in an array by line.

Sorry, that output is not in the list display, that is a direct copy to clipboard of the string from a body read. I just want to be able to split the separate lines, but i don't know how to since there is no character between the lines.

Does this return an object (a table object) for you? $oTable = _IEGetObjByName($oIE,"Checking 9 Detail")

I do not see anything with that name in the HTML you posted. I would typically use _IETableGetCollection($,IE, index) where index is a zero-based index of the table numbered as the tables appear on the page...

Dale

No it doesn't, i get the @error = 7. I did use the tableGetCollection to get a list of tables and that was the one listed, but then I couldn't find it in the HTML either.

Link to comment
Share on other sites

Sorry, your reply is too ambiguous. For more help you'll need a better description.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I have a string with two or more lines:

06/29/2007Withdrawal @ QT 643 06006Trace #027284-$20.01$1,109.73

06/30/2007Withdrawal @ LOWE'S #75Trace #028548-$6.42$1,103.31

07/06/2007Deposit-ACH-A-TGT (REG SALARY)$75.00$1,178.31

I want to be able to split the lines into separate strings or into an array if possible.

The problem I'm having is that I don't know what to use as the delimiter to split the string into separate lines. This is because there is no character between the lines in the string. The format is as if I had been typing and then hit "ENTER" to start a new line.

I'm not having a problem with splitting the lines into categories (date, amount, total, etc) I just need to split so in the above example I would have 3 strings, or an array with 3 parts.

Thank you for your help and I hope I'm making more sense.

Link to comment
Share on other sites

Look up @cr @lf and @crlf in the help file. Your lines are separated by one or more of those characters...

The format is as if I had been typing and then hit "ENTER" to start a new line.

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
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...