Jump to content

IE search text if exist


Kyme
 Share

Recommended Posts

hi guys

i have one question...it's out there some function who it's able to search all page to see if some text exist or not???

for example

search www.google.ro if exist text Log In

tnx

Regards,kyme

Edited by Kyme
Link to comment
Share on other sites

_IEBodyReadText() and StringInStr()

oky i try this one but i add random word to search(un existend) and my script say detected:|

#include<IE.au3>
$oIE = _IECreate("www.google.com",0,1)
_IELoadWait($oIE)
$txt = _IEBodyReadText($oIE)
$word2="20082314234234234452345345"
If StringInStr($txt,$word2) then
Msgbox(0, "Text detected", $word2)
Else
Msgbox(0, "Text detected", $word2)
EndIf
_IEQuit($oIE)

Edit:please guys help me with this

Edited by Kyme
Link to comment
Share on other sites

Straight from Welcome to Autoit 1-2-3

; Read the contents of the body of a webpage and search for a string. If the string is found, replace it 
; with a new string and write it back to the webpage.

#include <IE.au3>

$oIE = _IECreate()
_IENavigate($oIE, "http://www.autoitscript.com/")

$body = _IEBodyReadHTML($oIE)

If StringInStr($body, "automation") Then
    MsgBox(0, "Success", "The string was found")
    $newbody = StringReplace($body, "automation", "AUTOMATION - Yeah!")
    _IEBodyWriteHTML($oIE, $newbody)
Else
    MsgBox(0, "Fail", "The string was NOT found")
EndIf

Exit

8)

NEWHeader1.png

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...