Jump to content

IE get some values from <tr> and <td>


Vision
 Share

Recommended Posts

Hallo guys,

i have a control panel, and i want to automate it.

<tr>
<td align=center style='padding: 0px'><a href="search.php?cat=46"><img border="0" src="pic.gif" alt="Picture" /></a></td>
<td align=left border=0><table border=0 width="100%" cellspacing="0" cellpadding="0" border="0" class=embedded><tr border=0 class=embedded><td align=left style="width:100%" cellspacing="0" cellpadding="0" border="0" class=embedded><a title="Customer Number 1" href="details.php?id=292286&amp;hit=1"><b>Customer Number 1</b></a> (<b><font color=red>neu</font></b>)
<td align=right class=embedded>  <a href="contact/contacts.php"><img src="ddl.png" title="Get" border=0></a></td><tr><td align=right class=embedded></td></tr></tr></table></td>
</td>
<td align="right"><b><a href="details.php?id=292286&amp;hit=1&amp;filelist=1">7</a></b></td>
<td align="right">0</td>
<td align=center><nobr>2011-09-21<br />06:03:57</nobr></td>
<td align=center>19.32<br>Percent</td>
<td align=center>1<br>time</td>
<td align=right><b><a href=details.php?id=292286&amp;hit=1&amp;tocontact=1><font color=#000000>2</font></a></b></td>
<td align="right">0</td>
<td align="center">6</td><td align=center><i>Products</i></td>
</tr>

how i can get a array that returns me for example:

<a title="Customer Number 1"

array[1] ="Customer Number 1"

and

href="details.php?id=292286&amp;hit=1">

array[2]= 292286 ; (ID)

and

<td align=center>19.32<br>Percent</td>

array[3]=19.32 ;Percent

the page i want to automate is full of this html elements

hope someone can help me

br

Link to comment
Share on other sites

You didn't show the parent table of those rows, but you should look at _IETableWriteToArray() in the help file.

:graduated:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • 2 weeks later...

You can do your own HTML parsing by using _StringBetween/StringRegExp

Some idea for you to getting started:

$test = GetTag('TD')

 
Func GetTag($tag)
    $result = StringRegExp($html, '(?s)<' & $tag & '.*?>(.*?)</' & $tag & '>', 3)
    If UBound($result) > 0 Then Return $result[0]
    Return ''
EndFunc
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...