Jump to content

Problem wih _IEBodyFindText [author yehia]


Recommended Posts

I had used Functions IE New of author yehia but when me made with function _IEBodyFindText then not found anything although the text has on site :)

And this is my code

#include <IE.au3>
Func _IEBodyFindText(ByRef $o_object, $s_text, $i_SearchScope = 0, $i_Flags = 0)
    If Not IsObj($o_object) Then
        __IEErrorNotify("Error", "_IEBodyFindText", "$_IEStatus_InvalidDataType")
        SetError($_IEStatus_InvalidDataType, 1)
        Return 0
    EndIf
    If Not __IEIsObjType($o_object, "documentContainer") Then
        __IEErrorNotify("Error", "_IEBodyFindText", "$_IEStatus_InvalidObjectType")
        SetError($_IEStatus_InvalidObjectType, 1)
        Return 0
    EndIf
    If Not IsInt($i_SearchScope) Or IsInt($i_Flags) Then
        __IEErrorNotify("Error", "_IEBodyFindText", "$_IEStatus_InvalidValue", "Invalid integer value")
        SetError($_IEStatus_InvalidValue, 3)
        Return 0
    EndIf
    $oDoc = $o_object.document
    $oTextRange = $oDoc.body.createTextRange()
    $found = $oTextRange.findText($s_text,$i_SearchScope,$i_Flags)
    If $found = -1 Then
        SetError($_IEStatus_Success)
        Return 1
    EndIf
EndFunc
$oIE = _IECreate ("http://google.com.vn")
$b = _IEBodyReadText ($oIE)
$test = _IEBodyFindText ($oIE, "Blog",0,0)
msgbox (0,"",$test)

Please help me !!!

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