Jump to content
Sign in to follow this  
oulaya

comment je peux ecrire qlq chose dans champ texte

Recommended Posts

oulaya

j ai un page hatml mal structure les form ont pas de nom du coup jai creer une fonction GetDivByClass afin de lire la div mais jai des erreurs For $div In $divs
For $div In $divs^ ERROR helppp

Share this post


Link to post
Share on other sites
oulaya

ok i hav ea problem with my page HTML because there is no name of form so i decid to create function  GetDivByClass but ther is a problem For $div In $divs^ ERROR helppp

helpp

Share this post


Link to post
Share on other sites
oulaya

here the code :

Func GetDivByClass(ByRef $o_object, $s_linkText, $i_index = 0, $f_wait = 1)
    If Not IsObj($o_object) Then
        __IEConsoleWriteError("Error", "GetDivByClass", "$_IEStatus_InvalidDataType")
        SetError($_IEStatus_InvalidDataType, 1)
        Return 0
    EndIf
    ;
    Local $found = 0, $div, $linktext, $divs = _IETagNameGetCollection($o_object, "DIV")
    $i_index = Number($i_index)
;~     For $link In $links
                ;~ MsgBox(0, "Link-Found", $found)
;~                 If IsObj($link) Then
                    ;~ MsgBox(0, "Link-Objet:", "OK")
;~                 EndIf
                ;~ MsgBox(0, "Link:", $link)
                ;~ Local $imgs = $link.images
;~                 $imgs = _IETagnameGetCollection($o_object, "DIV")
                ;~ For $oTD in $oTDs
                ;~ If String(_IEPropertyGet($oTD, "innerHTML", "¤~ Shipments set for Clarification") Then _IEAction($oTD, "click")
                ;~ Next
                For $div In $divs
                    If IsObj($div) Then
;~                         MsgBox(0, "Objet-Img:", "OK")
                    EndIf
                    $linkimgtext = ""
;~                     $linkimgtext = $div.outertext
                    $linkimgtext = $div.className
;~                     $linkimgtext = $img.title & ""
;~                     MsgBox(0, "Link-outertext:", $img.outertext )
                    ;~ MsgBox(0, "Link-href:", $link.id&"-"&$link.href)
                    ;~ MsgBox(0, "Img-Name:", $img.title & "-" & $img.src)
;~                     If StringInStr($linkimgtext,$s_linkText) Then
                    If $linkimgtext == $s_linkText Then
;~                         if IsDeclared("div.id") AND $div.id<>"" then MsgBox(0, "Div-Id:", $div.id)
;~                         if IsDeclared("div.classname") AND $div.className<>"" then MsgBox(0, "Div-className:", $div.className)
;~                         if IsDeclared("div.outertext") AND $div.outertext<>"" then MsgBox(0, "Div-outertext:", $div.outertext)
;~                         if IsDeclared("div.innertext") AND $div.innertext<>"" then MsgBox(0, "Div-innertext:", $div.innertext)
;~                         if IsDeclared("div.tagname") AND $div.tagname<>"" then MsgBox(0, "Div-Tagname:", $div.tagname)
                        If ($found = $i_index) Then
;~                             $link.click
                            If $f_wait Then
;~                                 _IELoadWait($o_object)
;~                                 SetError(@error)
;~                                 MsgBox(0, "Div-OuterText OK:", $linkimgtext)
;~                                 MsgBox(0, "Div-OuterText ClassName:", $div.className)
;~                                 MsgBox(0, "Div-OuterText OuterText:", $div.outertext)
                                Return $div.outertext
                            EndIf
                            SetError($_IEStatus_Success)
                            Return $div.outertext
                        EndIf
                        $found = $found + 1
                    EndIf
                Next
                ;~ _IEImgClick($oIE,"Créer à partir de","title")


                ;~ MsgBox(0, "Link-Name:", $link.name)
                ;~ if IsDeclared("link.id") AND $link.id<>"" then MsgBox(0, "Link-Id:", $link.id) EndIf
                ;~ MsgBox(0, "Link-onclick:", $link.onclick)
                ;~ MsgBox(0, "Link-href:", $link.href)
                ;~ MsgBox(0, "Link-OuterText:", $link.outertext)
                ;~ $linktext = $link.outerText & "" ;~ Append empty string to prevent problem with no outerText (image) links
;~     Next
    __IEConsoleWriteError("Warning", "GetDivByClass", "$_IEStatus_NoMatch")
    SetError($_IEStatus_NoMatch) ;~ Could be caused by parameter 2, 3 or both
    Return 0
EndFunc   ;==>_IELinkClickByText

 

Edited by JLogan3o13

Share this post


Link to post
Share on other sites
rodent1

Il te manque une déclaration "Include", " #include <IE.au3> " au debut de ton script

You are missing an "Include" statement, " #include <IE.au3> " on top of your script

Share this post


Link to post
Share on other sites
oulaya

oui deja j ai declare include

 

Share this post


Link to post
Share on other sites
JLogan3o13

@oulaya in the future, please post your code using the <> symbol on the toolbar. It puts the code into a pretty box that keeps our eyes from bleeding while trying to read it. I have done it for you in your post above.

Also, as this is an English forum, please use Google Translate or some other method to translate your questions/answers into English before posting. It allows a larger number of folks to offer assistance to you.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
oulaya

ok thank you

Edited by Jos

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  

×