Jump to content

Search the Community

Showing results for tags '_ietagnamegetcollection'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 9 results

  1. Hi guys! I have these checkbox that I'm trying to click on. They have the same inner-text string but a different ID. Sometime there can be as many as 4 checkbox with the same string but the ID is always different. I tried a few methods down below but I'm unable to make any real results. Any suggestions or solutions I would appreciate it very much. <ul><li class="cx-list-item-wrapper" data-day="Aug 2 2018 07:27:37 GMT-0700 (Pacific Daylight Time)"><div class=""><div class="cx-list-item-container"><div class="cx-list-item cx-item-icon-2 pointer-cursor"><div class="cx-item-contents cx-item-time col-md-2"><!-- react-text: 675 -->Morning<!-- /react-text --><!-- react-text: 676 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 678 -->OTHER<!-- /react-text --><!-- react-text: 679 -- >&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 681 -->8:30 AM<!-- /react-text --><!-- react-text: 682 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 684 -->10:30 AM<!-- /react-text --><!-- react-text: 685 -->&nbsp;<!-- /react-text -- ></div><div class="cx-item-contents col-md-1"><!-- react-text: 687 -->SRV<!-- /react-text --><!-- react-text: 688 -->&nbsp;<!-- /react-text --></div></div></div><div class="pull-right cx-listitem-chk"><div><input id="cx_checkbox1" class="cx-fa-chk cx-selfschedule-chk" value="on" type="checkbox"><label for="cx_checkbox1"></label></div></div></div></li><li class="cx-list-item-wrapper" data-day="Aug 2 2018 07:27:37 GMT-0700 (Pacific Daylight Time)"><div class=""><div class="cx-list-item-container"><div class="cx-list-item cx-item-icon-2 pointer-cursor"><div class="cx-item-contents cx-item-time col-md-1"><!-- react-text: 698 -- >Morning<!-- /react-text --><!-- react-text: 699 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 701 -->OTHER<!-- /react- text --><!-- react-text: 702 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 704 -->8:30 AM<!-- /react-text --><!-- react-text: 705 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 707 -->2:30 PM<!-- /react-text --><!-- react-text: 708 -- >&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 710 -->SRV<!-- /react-text --><!-- react-text: 711 -->&nbsp;<!-- /react-text --></div></div></div><div class="pull-right cx-listitem-chk"><div><input id="cx_checkbox2" class="cx-fa-chk cx-selfschedule-chk" value="on" type="checkbox"><label for="cx_checkbox2"></label></div></div></div></li></ul> I tried the _IETagNameGetCollection() but it only check the box but doesn't fire the event! And I'm unable to submit that without a click action. Func _Box1() $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput In $oInputs If $oInput.id == "cx_checkbox1" Then $oInput.checked = true Next Sleep(10) ToolTip('box1') EndFunc ;==>_Box1 I also tried click by text.The boxes do get check by a click but the problem with that is it will select every box that has the same string. I'm allowed only to check 1 box selection at a time per day for the submit button to work. Any preference to select only the second box and bypass the other? Func _Morning() For $a In _IETagNameGetCollection($oIE, "div") If StringInStr(_IEPropertyGet($a, "innerText"), "Morning") Then _IEAction($a, "click") EndIf Next Sleep(10) ToolTip('Morning selected') EndFunc ;==>Morning The last method I tried was _IEGetObjById(). It doesn't click or respond to the checkbox. Func _Click1() $oChk = _IEGetObjById($oIE, "cx_checkbox1") _IEAction($oChk, 'click') Sleep(20) ToolTip('box1') EndFunc ;==>_Click1
  2. Hi All, I'm using an online translator for Spanish in which you give the verb and website gives the conjugations. The website I'm using is: http://www.spanishdict.com/conjugate/tener where "tener" means "to have" in English. In the screenshot, you can see the present tense (5 yellow highlighted items) and the imperfects (5 blue boxes). I don't need to get the translation for "vosotros", so I didn't make any color on that row. I'm trying to get these 10 translations to be written on the output for my code. But my code is so simple (because I couldn't go into the div / tr / td): #include <IE.au3> #include <Array.au3> Local $sSpanishWord = "tener" ;to have ;Local $sSpanishWord = "abrir" ;to open Local $oIE = _IECreate ("http://www.spanishdict.com/conjugate/" & $sSpanishWord) ;http://www.spanishdict.com/conjugate/tener ;http://www.spanishdict.com/conjugate/abrir ;== Try using _IETagNameAllGetCollection Local $oElements = _IETagNameAllGetCollection($oIE) For $oElement In $oElements If $oElement.id Then ConsoleWrite("Tagname: " & $oElement.tagname & @CRLF & "id: " & $oElement.id & @CRLF & "innerText: " & $oElement.innerText & @CRLF & @CRLF) EndIf Next ;== Try using _IETagNameGetCollection Local $sTable Local $oTableCells Local $oTableRows = _IETagNameGetCollection($oIE, "tr") For $oTableRow In $oTableRows $sTable = "" $oTableCells = _IETagNameGetCollection($oTableRow, "td") ;I don't know how to continue from here on Next I used the IE to find out the tr / td stuff, but I think I'm lost. P.S: The verb "tener" can be difficult, because it has red letters because of irregular. The verb "abrir" can be much easier, because it's a regular verb.
  3. Hi, I'm using the IE.au3 library to parse elements in a webpage and get their (x,y) coordinates. Main commands I'm using are : $oIE = _IECreate($myWebPage) $oElements = _IETagNameGetCollection($oIE, "label") $windowleft = $oIE.document.parentwindow.screenLeft $windowtop = $oIE.document.parentwindow.screenTop $oElementPosX = $windowleft + _IEfindPosX($oElement) $oElementPosY = $windowtop + _IEfindPosY($oElement) Now things become a bit tricky when i simulate a scroll in my webpage : $oIE.document.parentwindow.scroll(0, $myScrollY) Because once this is done, the coordinates of the elements are still what they were before the scroll. I can manage this problem by keeping track of the number of pixels I have scrolled, and compute the new "real" ($oElementPosX, $oElementPosY). But I'm pretty sure there's a more efficient / more elegant way to do it. What's more in some situations, when I click some controls in the webpage, the webpage adds new elements and shifts the controls below by a random number of pixel, so my workaround can't be used... So here's my question : Is there a way to "refresh" the calculation of label coordinates ($oElementPosX, $oElementPosY) after a scroll ? Thank you ! EDIT : I forgot to post the _IEfindPosX and _IEfindPosY functions (found somewhere on this forum) : Func _IEfindPosX($o_object) Local $curleft = 0 Local $parent = $o_object If IsObj($parent) Then While IsObj($parent) $curleft += $parent.offsetLeft $parent = $parent.offsetParent WEnd Else Local $objx = $o_object.x If IsObj($objx) Then $curleft += $objx EndIf Return $curleft EndFunc Func _IEfindPosY($o_object) Local $curtop = 0 Local $parent = $o_object If IsObj($parent) Then While IsObj($parent) $curtop += $parent.offsetTop $parent = $parent.offsetParent WEnd Else Local $objy = $o_object.y If IsObj($objy) Then $curtop += $objy EndIf Return $curtop EndFunc
  4. I'm trying to create an autoPop tool for AliExpress. When I get to their address page, there are a number of input fields. There are also two drop downs. One is for the country and, depending on what you select, the other dropdown appears with city names or, a standard input box is visible to add a city (See the images). So if I select "United States" the other dropdown is visible with all the states. If I select "France", the input box is visible to enter a French city. Seems cool enough but I'm really struggling trying to get this to work. This is my test code to work all this out: #include <MsgBoxConstants.au3> #include <IE.au3> Local $StartPos Local $oIE = _IECreate("https://shoppingcart.aliexpress.com/order/confirm_order.htm?objectId=1792065272&from=aliexpress&countryCode=US&shippingCompany=EMS&provinceCode=&cityCode=&promiseId=&itemCondition=&=556&aeOrderFrom=main_detail&skuAttr=&quantity=1") If @error Then Exit MsgBox(16, "openURL Error", @CRLF & "@error = " & @error & ", @extended = " & @extended) ;If $bVerbose == true Then MsgBox(0, "openURL", "IECreate Object Created") ;Get the Collections $oInputs = _IETagNameGetCollection($oIE, "input"); Input Fields $oSelects = _IETagNameGetCollection($oIE, "select"); Select Fields ;Loop through the Selects For $oSelect In $oSelects If $oSelect.name = "country" Then _IEFormElementOptionSelect($oSelect, "France", 1, "byText",1) Next ;Loop through the inputs For $oInput In $oInputs If $oInput.name = "email" Then $oInput.Value = "test@test.com" If $oInput.name = "contactPerson" Then $oInput.Value = "My Full Name" If $oInput.name = "address" Then $oInput.Value = "123 Anystreet" If $oInput.name = "address2" Then $oInput.Value = "NA" If $oInput.name = "province" Then MsgBox(0, "","$oInput.name = " & $oInput.name &@CRLF &"$oInput.style = " & $oInput.style &@CRLF &"$oInput.type = " & $oInput.type&@CRLF &"$oInput.maxLength = " & $oInput.maxlength) $oInput.Value = "FrenchyLand" EndIf If $oInput.name = "city" Then $oInput.Value = "AnyTown" If $oInput.name = "zip" Then $oInput.Value = "12345" If $oInput.name = "mobileNo" Then $oInput.Value = "1-415-555-1212" Next So I open the page on AliExpress and get an "input" collection and a "select" Collection I first loop through the Selects until I find "country" and then select "France" I then loop through all the inputs and put the information in the correct inputs. When the country is one that AliExpress knows the states or provinces for, they swap Styles between the input box and the dropdown to either "display: inline-block;" or "display: none;" which hides one, or the other (See the AliExpDOM Image). Problem #1: When I use the "_IEFormElementOptionSelect($oSelect, "France", 1, "byText",1)" To make the dropdown selection, It selects it but does not invoke the widget to change the second dropdown to an input box. Problem #2: I thought a possible solution would be to read the Style of the input box and based on the value, either place text in the input box or go to the dropdown and make a selection. I can't seem to read the Style attribute from the collection ie: $oInput.style returns nothing. Any help here would be greatly appreciated. If I figure out a solution before and answer here, I will publish it here for anyone else who might be struggling with these kinds of things Thanks
  5. Hi all, I got the need of crawling all the label tag contained within a div element, and then inspecting one by one looking for a specified content Local $reportForm=_IEFormGetObjByName($oIE,"ui_form") If @error Then ConsoleWrite('_IEFormGetObjByName @error = ' & @error & ' @extended = ' & @extended & @CRLF) EndIf Local $divTagSites = _IEGetObjById($reportForm, "divElementId") If @error Then ConsoleWrite('_IEGetObjById for @error = ' & @error & ' @extended = ' & @extended & @CRLF) EndIf Local $divLabels = _IETagNameGetCollection($divTagSites, "label") If @error Then ConsoleWrite('_IETagNameGetCollection for label @error = ' & @error & ' @extended = ' & @extended & @CRLF) EndIf ConsoleWrite('_IETagNameGetCollection @extended = ' & @extended & @CRLF) For $divLabel In $divLabels ConsoleWrite($divLabel.for & @CRLF) Next the html looks like the following <div id="divElementId"> <td nowrap="nowrap"> <span> <input id="divElementId_ctl01" type="checkbox" name="divElementId$ctl01" onclick="some JavaScript stuff" /> <label for="divElementId_ctl01_ctl01">ele-1000002 [1000002]</label> </span> </td> </div> what I'd like to perform is to access the label element text ele-1000002 [1000002] comparing to a variable and then check the corresponding checkbox. What I miss is the step: accessing the text inside the label tag. TIA. PS: searching through the forum I found out only method based on analyzing the whole html page.
  6. Dear guys, i have a trouble, maybe someone will can help me? I need to open an javascript link and can't find solution. ArchoTag of the link: Index: 22 Tag: A Name: cmntLnk Extra Information: Link Text: Link 31 Extra Information: Href: javascript:; Obj Type: DispHTMLAnchorElement I think there is 3 solutions: By clicking the dynamic text "Link 2 or Link 123 or Link n" By opening javascript href. there is 5 javascripts. Or by using _IETagNameGetCollection, i don't know how to use this function to open link Now i try it, but IELinkClickByText don't click on A tag link: $oElements = _IETagNameGetCollection($oIE,"A") $text = "" For $oElement In $oElements StringRegExp($oElement.innerText, "Link") If not @error then $text = $oElement.innerText Next _IELinkClickByText($oIE,$text) Any tips pls how to open this link. Thank you. EDIT: Fix CODE.
  7. HI, I cannot work out how to connect to the input box on this link: https://cms.bskyb.2wire.com/manage/login My usual method is in my code but it does not seem to find the elements I need to connect with. I can see that "text" and "password" are on the page but im confused about putting input to it. Can someone point me in the right direction? Kind Regards Dave #include <IE.au3> #include <MsgBoxConstants.au3> $PACE = _IEAttach("https://cms.bskyb.2wire.com/manage/login", "url") If @error Then MsgBox($MB_SYSTEMMODAL, "Error", "PACE not attached") $PACE =_IECreate("https://cms.bskyb.2wire.com/manage/login") EndIf $colForms = _IEFormGetCollection ($PACE ) For $oForm In $colForms $colElements = _IETagNameAllGetCollection ( $oForm ) For $oElement In $colElements If StringInStr ( $oElement.getAttribute ( "tkPid", 2 ), "PID19" ) <> 0 Then MsgBox(0, "Result", "Success") _IEFormElementSetValue($oElement, "username") ;~ _IEAction ( $oElement, "click" ) Else EndIf If StringInStr ( $oElement.getAttribute ( "__eventBits=", 2 ), "7409" ) <> 0 Then MsgBox(0, "Result", "Success") _IEFormElementSetValue($oElement, "password") ;~ _IEAction ( $oElement, "click" ) Else EndIf Next Next Local $oInputs = _IETagNameGetCollection($PACE, "input") Local $sTxt = "" For $oInput In $oInputs $sTxt &= $oInput.type & @CRLF if $oInput.type = "text" Then EndIf Next MsgBox($MB_SYSTEMMODAL, "Form Inqput Type", "Form: " & $oInput.form.name & @CRLF & @CRLF & " Types :" & @CRLF & $sTxt)
  8. I can't find solution to check if object have variable or not, i have 2 variables in object, i use: $oIE = _IECreate('D:\Dropbox\Projects\au3\IE_Builder\test.html') $oInputs = _IETagNameGetCollection($oIE, "form") For $oInput In $oInputs $d = $oInput.name If $d = 0 then ConsoleWrite("Form: " & $d & @CRLF) Next And result is: Form: 0 Form: d3e8f5e3ba12 I have tried many solutions, but no one works.... pls help. i can't separate this variables..
  9. I'm trying to pull the class from a table. I have no problem pulling the href but the class is giving me errors. Here is what i'm trying to do. $oForm = _IETableGetCollection ($oIE, 3) $oLinks = _IETagnameGetCollection($oForm, "TR") For $oLink in $oLinks ConsoleWrite($oLink.class & @CRLF) NextSo it appears i can't call for .class like i am. Does anyone have any suggestions? This seems to work just fine though $oForm = _IETableGetCollection ($oIE, 3) $oLinks = _IETagnameGetCollection($oForm, "a") For $oLink in $oLinks ConsoleWrite($oLink.href & @CRLF) Next An example of one of the cells in the table-- <tr align="left" class="color"><td><a href="http://autoitscript.com">Good friendly People</a></td> So what i'm looking for is how to pull out the "color" and add it to the table i'm creating in the next step. I'd really like to just look within the table and not the entire sheet. Thanks!
×
×
  • Create New...