Jump to content
Sign in to follow this  
Kyme

IE search text if exist

Recommended Posts

Kyme

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

Share this post


Link to post
Share on other sites
Kyme

_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

Share this post


Link to post
Share on other sites
Valuater

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.