Jump to content
Sign in to follow this  

search and destroy - well, select actually. IE.au3

Recommended Posts

My brain is melting and I cant figure out how to accomplish a task. Can someone point me in the right direction?

I have a text string that I want to check against text on a web page. If there is a match, highlight the found text. I then need to send a "shift + tab" to jump to the checkbox to the left of the found text and then a "space" to activate the checkbox. I can confirm the string exists by reading the HTML, and doing a stringinstr match, but I think im barking up the wrong tree with this approach.

Attached is a copy of the page im trying to match to. I have coded the srcipt to look for it at c:\

#include <IE.au3>

Dim $string="MSB 131", $Result, $site="file:///C:/pre-configured%20participants.htm"

$oIE = _IECreate ($site)
_IELoadWait ($oIE)

_SearchText ($string)
MsgBox (0,"searchtext", $Result)

Func _SearchText ($_TextString)
    dim $TextString = $_TextString
    $PageHTML = _IEDocReadHTML($oIE)
    $Result = StringInStr ($PageHTML, $TextString)

Any help would be appreciated.

pre-configured participants.htm

Share this post

Link to post
Share on other sites

if anyone is feeling ambitious, I have another related problem. I would like the search to poll all 4 pages of available endpoints, but I cant figure out how to hit the page links. They seem to be java generated and all have the same input name, but different values. Im still green and developing a flat spot on my forehead trying to figure it out.

Share this post

Link to post
Share on other sites

Hmm, found that doing a search "ctrl+f" in IE accomplishes the same task. I should be able to script that, but not sure how to confirm the Ctrl+F has found a hit or not. Prefer to do it with code if I can, just so I can be sure of a match.

On another note, am I not getting any responses because people are reluctant to download an HTML file to their system? Or is there a perception that i did not try hard enough to solve the issue? Usually the response is swift and right on the money...

Thanks all.

Share this post

Link to post
Share on other sites

OK putting this one to bed. I did manage to get it working with the following:

$StrLen = StringLen ($newstring)
$cutpoint = StringInStr ($PageHTML,$newstring)
$HTMLclip = StringMid ($PageHTML,($cutpoint-100),(100+$StrLen))
$newstring=StringTrimLeft($HTMLclip,(StringInStr ($HTMLclip, "h323",0,-1)))
$newstring=StringTrimRight($newstring,((StringLen ($newstring)-7)))
$newstring=StringStripWS($newstring, 2)
If StringRight($newstring,1) = ">" Then $newstring = StringTrimRight($newstring,1)

this basically searches the html source code for the initial string, and searches backward for the checkbox name that preceeds it. It then parses out what it needs so i now have the checkbox name associated to the orginal search text. I will raise the checkbox issue as a new item. (page has no form)

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...