I'm not sure ArrayFind would help you here, as the data returned by ChromeFindElements isn't what you're looking for until you've used ChromeGetElementData - so you have to loop through the ChromeFindElements array anyway.
Also, according to the helpfile for ArrayFind -"Stops at the first matching index and returns the index of the item in result". This means it would only find the first result anyway, not all of them if there happened to be more than 1.
The code below will extract table rows, then check to see if they contain your search term (Dorian). If it does, it removes the search term (column1) from the result string, trims it, thus leaving the contents of column2.
Try it on the attached file (
chrometest.txt - make sure to rename it to chrometest.htm)
EDIT : File upload was flagged as unsafe. Here's the html :
Code: Select all
<html><body>
<table>
<tr>
<th>First name</th>
<th>Last name</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
<tr>
<td>Jane</td>
<td>Doe</td>
</tr>
<tr>
<td>Dorian</td>
<td>Ellis</td>
</tr>
</table>
</body>
</html>
As ever, there may be other ways to do this, but this one works.
Code: Select all
let>TheURL=d:/chrometest.htm
Let>MySearchText=Dorian
Let>CHROMEDRIVER_EXE=c:\chromedriver.exe
ChromeStart>session_id
ChromeNavigate>session_id,url,%TheURL%
wait>4
//Extract all rows
ChromeFindElements>session_id,tag name,tr,elements
//Loop through all rows, extracting element data
Let>CheckLoop=0
Repeat>CheckLoop
Let>CheckLoop=CheckLoop+1
ChromeGetElementData>session_id,elements_%CheckLoop%,text,TheText
//Does this row contain our search text?
Pos>MySearchText,TheText,1,PosSearch,
//If so, do something with it
If>PosSearch>0
StringReplace>TheText,MySearchText,,TheText
LTrim>TheText,TheText
MDL>TheText
Endif
Until>CheckLoop,elements_count