oulaya Posted March 15, 2016 Posted March 15, 2016 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
JohnOne Posted March 15, 2016 Posted March 15, 2016 Post code, and use translator for your question. oulaya 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
oulaya Posted March 15, 2016 Author Posted March 15, 2016 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
oulaya Posted March 15, 2016 Author Posted March 15, 2016 (edited) here the code : expandcollapse popupFunc 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 March 15, 2016 by JLogan3o13
rodent1 Posted March 15, 2016 Posted March 15, 2016 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
Moderators JLogan3o13 Posted March 15, 2016 Moderators Posted March 15, 2016 @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. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
oulaya Posted March 15, 2016 Author Posted March 15, 2016 (edited) ok thank you Edited March 15, 2016 by Jos
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now