Jump to content

table data inside another table data


Recommended Posts

Hi,

Please look at the screenshot taken from the internal tool source code. I am trying to extract "Investments" from the below source code.

<td align="LEFT">Investments&nbsp;</td>

Below is my code:

$sHTML = _IEDocReadHTML($oIE1)
$array = StringRegExp($sHTML, '(?i)">(.*?)</(?i)td>', 3)
For $a = 0 To UBound($array) - 1
    $Date = $array[$a]
    MsgBox(0, "", $Date)
Next

but the above code extracts just "10021" and then "State Employees CU (NC) (Member View) - Investments" and then moves to the second row in the table without moving to the next element. It seems that because <td>... </td> is closed script is not moving to next element.

 

post-80752-0-78824000-1396120162_thumb.j

Link to comment
Share on other sites

If the text is really the same than in the image then the code should work

$str = '<td align="LEFT">Finance&nbsp;</td>' & @crlf & _
    '<td align="LEFT">Investments&nbsp;</td>' & @crlf & _
    '<td align="LEFT">7868&nbsp;</td>' 

$array = StringRegExp($str, '(?i)">(.*?)</td>', 3)
For $a = 0 To UBound($array) - 1
    $Date = $array[$a]
    MsgBox(0, "", $Date)
Next
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...