Jump to content
Sign in to follow this  

Getting innerHTML or innerText error "The requested action has failed"

Recommended Posts





Edited by Wolfiesaxah

Share this post

Link to post
Share on other sites

is it possible that your script is searching for the innerhtml before the frame has finished loading completely? that is the problem i have sometimes.

my solution was to have my script check that the innerhtml is there, then search it for my string.

it may be sloppy but it's pretty reliable.

until $test<>""


if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post

Link to post
Share on other sites


But more to the point, if you're looking for a login feature text, it has an id/name/class more than likely.  Look for the object (eg. frame.document.getElementById("idOfTextLoginObject").value/innertext/outertext/innerhtml/outerhtml etc.) and get the text from that.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  

  • Similar Content

    • AnonymousX
      By AnonymousX
      I'm trying to write a script that can go to a specific work related webpage, then grab the html text out of a known recorded comment field. I have a basic understanding of HTML, but I'm confused by the website as when I open up source code I get something called frames/iframes. Not sure what that really is.... 
      Anyways using chrome and opening up source code it made a little more sense, and could trace all content I want falls within what I see as "top/mainFrame (retrieve.do)/notesActionHistoryHistory (iframeComments.jsp)/bcwebapp:8500/oinc"
      Is there an easy way to make a variable contain all the html text within this frame?
      Website is on companies intranet, and each project has it's own page. I need a way to go through an excel list of projects, open up the webpage to the respective projects, then grab all the comments for those projects, then paste everything into 1 text file. My idea is to copy the excel list into an array, then use it to go one by one to the different webpages and copy the comments into an array, then paste it all into a text file. I've pretty much got all the pieces figured out, except how to grab the actual html comment data. I can do it manually but who wants to do that...
      Thanks for any help in advance
    • taylansan
      By taylansan
      I'm trying to set the value of an input value in an iframe which is a cross reference.
      Here is my code:
      $oFrame = _IEFrameGetObjByName($oIE, "AID_1460048722447_iframe") If @error Then ConsoleWrite("Cannot get this frame" & @CRLF) EndIf If Not IsObj($oFrame) Then ConsoleWrite("Frame was not found" & @CRLF) EndIf ;try each item one by one $o1 = _IEGetObjById($oFrame, "serviceNo_input_value") $o2 = _IEGetObjByName($oFrame, "searchCond.serviceNo") $o3 = _IEFrameGetObjByName($oFrame, "searchCond.serviceNo") $o4 = _IEFormGetObjByName($oFrame, "searchCond.serviceNo") $o5 = _IEFormElementGetObjByName($oFrame, "searchCond.serviceNo") This is the output for each $o1 to $o5 trying:
      ;result for $o1 --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Program Files\AutoIt3\Include\IE.au3" (1899) : ==> The requested action with this object has failed.: If IsObj($oObject.document.getElementById($sID)) Then If IsObj($oObject^ ERROR ->00:08:17 AutoIt3.exe ended.rc:1 +>00:08:17 AutoIt3Wrapper Finished. ;result for $o2 "C:\Program Files\AutoIt3\Include\IE.au3" (1875) : ==> The requested action with this object has failed.: If IsObj($oObject.document.GetElementsByName($sName).item($iIndex)) Then If IsObj($oObject^ ERROR ->00:09:49 AutoIt3.exe ended.rc:1 +>00:09:49 AutoIt3Wrapper Finished. ;result for $o3 "C:\Program Files\AutoIt3\Include\IE.au3" (704) : ==> The requested action with this object has failed.: $oTemp = $oObject.document.parentWindow $oTemp = $oObject^ ERROR ->00:10:18 AutoIt3.exe ended.rc:1 +>00:10:18 AutoIt3Wrapper Finished. ;result for $o4 "C:\Program Files\AutoIt3\Include\IE.au3" (930) : ==> The requested action with this object has failed.: Local $oCol = $oObject.document.forms.item($sName) Local $oCol = $oObject^ ERROR ->00:10:33 AutoIt3.exe ended.rc:1 +>00:10:33 AutoIt3Wrapper Finished. ;result for $o5 --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop --> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType +>00:10:49 AutoIt3.exe ended.rc:0 +>00:10:49 AutoIt3Wrapper Finished. I have also checked these posts for reference, but I'm missing something which I cannot find.
      ie nested tables how to get to a nested table checking a checkbox that is inside an iframe html tag inside html tag how to select a radio button in an iframe iframe click a button cross domains I don't know how to copy the content of this html at once, so I provided in screenshot. Is there a way that I can get this element?

    • Lukeo
      By Lukeo
      I am trying to send external commands to a flash player in an iframe. I need to get a handle on it in a browser opened by the $oIE.navigate method.
      is there a way that this can be done?
    • Wolfiesaxah
      By Wolfiesaxah
      Hi guys, I need help as I have worked for more than 18 hours in trying to get this resolved but couldn't. There's a registration page that has an iframe and I need to put a check on the checkbox inside that iframe. The iframe's content is pointing to external source.
      Could anybody please share a complete simple _IE code to put a check on any of the checkbox in that page so I can analyze it and post my solution here? I am having trouble understanding the syntax of AutoIt. I tried this for hours and couldn't get it to work. The checkbox ID is showing as NOMATCH in AutoIt error report so I thought I had to reference the iFrame first but the iFrame too shows as NOMATCH when they are both sitting there.
    • boshi
      By boshi
      Hello Autoit fella..

      I made a script to fill in form but the problem is, the script cannot detect the text area because it is inside the Facebook Iframe [as the screenshot attached]

      the url usually like this: https://www.facebook.com/thefanpagename?sk=app_163706647070644
      meaning it is an apps inside facebook. the source code of the form as below:

      <div id="header_promotion" class="ss_box_header ss_promotion_header"> <h3>Promotion</h3> </div> <div id="content_promotion" class="ss_box_content ss_promotion_content"> <div id="header_msg_promotion" class="ss_promotion_header_msg"></div> <form id="form_promotion" class="ss_promotion_form" method="post" action="/facebook/form/3355393" novalidate="novalidate"><div style="margin: 0px; padding: 0px; display: inline;"><input name="authenticity_token" value="ZjE2tDCq2bCItnxLf79QXqtjkaZ2YI5pgl+DrIfPtb0=" type="hidden"></div> <input id="simulated" name="simulated" value="137101329662830" type="hidden"> <div id="promotion_email_block" class="field_block email_field_block"> <label for="promotion_email"><span class="main_field_label">Emel Anda</span><span class="required">*</span></label> <input id="promotion_email" name="promotion[email]" type="text"> </div> <div id="promotion_name_block" class="horizontal_container name_field_block"> <label for="promotion_name"><span class="main_field_label">Nama Anda</span><span class="required">*</span></label> <div id="promotion_first_name_block" class="field_block first_child first_name_field_block"> <input id="promotion_first_name" name="promotion[first_name]" type="text"> <label class="sublabel" for="promotion_first_name">First</label> </div> <div id="promotion_last_name_block" class="field_block last_name_field_block"> <input id="promotion_last_name" name="promotion[last_name]" type="text"> <label class="sublabel" for="promotion_last_name">Last</label> </div> <div class="clear"></div> </div> <div id="promotion_phone_block" class="field_block phone_field_block"> <label for="promotion_phone"><span class="main_field_label">Nombor HP</span><span class="required">*</span></label> <input id="promotion_phone" name="promotion[phone]" type="text"> </div> <div id="promotion_custom_field_1_block" class="field_block custom_field_1_field_block select_field_type_block"> <label for="promotion_custom_field_1"><span class="main_field_label">Negeri</span><span class="required">*</span></label> <select id="promotion_custom_field_1" size="0" name="promotion[custom_field_1]"><option value="WP Kuala Lumpur">WP Kuala Lumpur</option> <option value="Selangor">Selangor</option> <option value="Negeri Sembilan">Negeri Sembilan</option> <option value="Melaka">Melaka</option> <option value="Johor">Johor</option> <option value="Pahang">Pahang</option> <option value="Terengganu">Terengganu</option> <option value="Perak">Perak</option> <option value="Pulau Pinang">Pulau Pinang</option> <option value="Kedah">Kedah</option> <option value="Kelantan">Kelantan</option> <option value="Sabah">Sabah</option> <option value="Sarawak">Sarawak</option> <option value="WP Labuan">WP Labuan</option></select> </div> <div id="promotion_submit_block" class="field_block submit_field_block"> <a class="form_submit ss_btn" onclick="return SST.form_submit(widget_3355393);" href="#">Daftar</a> </div> <div id="message_promotion" class="ss_promotion_message ajax_message"></div> </form> <a style="display: none;" id="on_success_promotion" onclick="ss_gift_popup(gift_popup, widget_3355392, null, this); return false;" href="#"></a> </div> <div id="footer_promotion" class="ss_box_footer ss_promotion_footer"> </div>

      My autoit code goes like 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.