onlineth

_IE Action not working

10 posts in this topic

#1 ·  Posted (edited)

Hello, I believe I have come across a bug in the _IE library. I am trying to make a script that will automatically fill's in data for a restore script for a WP site. It's called Importbuddy by IThemes and it is one of the best, if not the best, backup restore plugins for WordPress. The problem that I am having is once it is on the first step of the script, filling in the password and clicking next, it redirects me to the index.php file and when I keep trying to return to the importbuddy.php file, it keeps redirecting back to the index file. Here is the code I am using, 

_$o = _IECreate() 
_IENavigate($o, [url of ImportBuddy]) 
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password");Password feild
_IEFormElementSetValue($step0, "pass");Password of Importbuddy
$Step0submit = _IEGetObjByName($o, "submit") 
_IEAction($Step0submit, "click") 
_IELoadWait($o, 2000)
;Goes to index.html, not the next step of the importbuddy

Here is a link to the importbuddy.php file,   http://bit.ly/1H9YZNb

Please only use this file for testing, it is part of a commercial product by IThemes 

To keep this simple, just install a program like XAMPP to view the file. Also, the password is "pass"

Does anyone have any ideas why this isn't working? 

As always, Thanks for your help 

Thomas 

Edited by onlineth

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Share this post


Link to post
Share on other sites



ok, I think I am going to take a different route on this. First I tried using the _IEFormSubmit but I keep getting an error of "2 ($_IEStatus_COMError) - COM Error in Object reference"

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
_IEFormSubmit($form)

So then I tried using the IE extended library but I can't get that to work either. Here is what I have for that,

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
$step0name = _IEGetObjByName($o, "submit")
_IEEx_JSMouseEventObjByName($o, $step0name, "mouseclick")
_IELoadWait($o, 2000)
I keep getting a "7 = No Match" error for that. I am running IE11

Also, the password for the http://test.onlineth.x10host.com/importbuddy.php is not "pass" but an extremely long string so no one will be albe to install anything malicious, it's just there so you can click on the button. If you click on it you should see this message, "Invalid password. Please enter the password you provided within BackupBuddy Settings. Attempt #."

Again, thanks for your help :)


online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Share this post


Link to post
Share on other sites

Appears to work if you drop _IEFormSubmit and use _IEAction instead:

;_IEFormSubmit($form)
$btnSubmit = _IEGetObjByName($o, "submit")
_IEAction($btnSubmit, 'click')

Share this post


Link to post
Share on other sites

 

Appears to work if you drop _IEFormSubmit and use _IEAction instead:

;_IEFormSubmit($form)
$btnSubmit = _IEGetObjByName($o, "submit")
_IEAction($btnSubmit, 'click')

Yes, but the issue is when I use _IEAction and "click", it redirects me to the index.html page (when I use the correct password) and when I try to navigate back to the /importbuddy.php it keeps redirecting back to the index.html file. If you can, put  the importbuddy.php file,  http://bit.ly/1H9YZNb, on a server and when you use the correct password(pass), you will see what I'm talking about. 


online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Share this post


Link to post
Share on other sites

Sounds like a configuration issue.  What happens if you manually click the button? 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Sounds like a configuration issue.  What happens if you manually click the button? 

It goes to the next step without any problems

EDIT

That's why I was exploring the other ways to see if that would work

Edited by onlineth

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Share this post


Link to post
Share on other sites

It goes to the next step without any problems

 

Not in my testing. Even if I manually enter the password, it initially displays the index. If I then go back and refresh the php page, it goes to the desired web page.

Share this post


Link to post
Share on other sites

Not in my testing. Even if I manually enter the password, it initially displays the index. If I then go back and refresh the php page, it goes to the desired web page.

Hmm, again, I am using this script,

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
$step0name = _IEGetObjByName($o, "submit")
;_IEEx_JSMouseEventObjByName($o, $step0name, "mouseclick")
$btnSubmit = _IEGetObjByName($o, "submit")
_IEAction($btnSubmit, 'click')
_IELoadWait($o, 2000)
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")

However when I use the _IENavigate it does nothing. Also, I added _IEQuit which also does nothing. What version of IE are you running? I'm only asking this because I've been reading about alternatives and it seems that the update from IE10 to 11 seems to have caused much conflict (I'm running IE11). Also, do you know why the other scripts I made don't work?

Thanks for help on this:)


online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Share this post


Link to post
Share on other sites

Sounds like you are running into the issue where an update from MS broke the IE scripting. Search the forum and you'll find the details and how to resolve it.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Does anyone know why the other scripts I have created don't work?

$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
_IEFormSubmit($form) 
$o = _IECreate()
_IENavigate($o, "http://test.onlineth.x10host.com/importbuddy.php")
_IELoadWait($o, 2000)
$step0 = _IEGetObjByName($o, "password")
$form = _IEFormGetCollection($o, 0)
_IEFormElementSetValue($step0, "pass")
$step0name = _IEGetObjByName($o, "submit")
_IEEx_JSMouseEventObjByName($o, $step0name, "mouseclick")
_IELoadWait($o, 2000)
Edited by onlineth

online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

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

  • Similar Content

    • nassausky
      By nassausky
      Hi all,
       
      Anyone have any idea how to close all open tabs except a specific one I manually open.  Assuming I don't know what is open in all the tabs except just the one I want to keep open.
       
      I didn't want to use sendkeys and I was trying to use the following code to list the title (or url) of the 3 open tabs and  after I got that part working I would just close the other 2. This sample only displays the title of the first open tab
      #include <IE.au3> Const $ie_new_in_tab = 0x0800 $oIE = _IECreate("https://www.autoitscript.com") __IENavigate($oIE, "https://www.autoitscript.com/forum/", 1, $ie_new_in_tab) ;(obj,url,wait,param) __IENavigate($oIE, "https://www.google.com/", 1, $ie_new_in_tab) ;(obj,url,wait,param) Local $aIE[1] $aIE[0] = 0 Local $i = 1, $oIE While 1     $oIE = _IEAttach("", "instance", $i)     If @error = $_IEStatus_NoMatch Then ExitLoop     ConsoleWrite(_IEPropertyGet($oIE, "title") & @CRLF)     ReDim $aIE[$i + 1]     $aIE[$i] = $oIE ;each item holds object     $aIE[0] = $i ;first item holds count     $i += 1 WEnd MsgBox($MB_SYSTEMMODAL, "Browsers Found", "Number of browser instances in the array: " & $aIE[0]) ; This doesn't return the list of tabs in the console just the first tab  
      Thanks for any and all help
    • toto22
      By toto22
      I'm trying to click on Java Dropbox using IE. However, I'm running into problems. There is a Dropbox "Please Select" with two options "Buy" and "Sell".
      I'm able to click on a drop box (please see code below) but i'm unable to select "Buy" or "Sell"".
      Local $sMyString = "Please Select" ;############ ENTER ############# Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next  
      Please help
       
         
    • Gowrisankar
      By Gowrisankar
      Hello everyone,
      I'm working on a task where, a PDF file is opened (in IE browser) when I click a link in a website.
      I have to read the first page of the PDF to find particular strings. Can you please share some ideas?
    • Seminko
      By Seminko
      Hey,
      i would like to set a value into an INPUT field.
      Checked the _IEFormElementSetValue function but that does require _IEFormGetObjByName and this is where the problem comes in. The input field I want to write to is not a part of a form tag. It is part of a table.
      <input type="text" class="w2" id="nabidka_vozidel_formular_tach_od" name="nabidka_vozidel_formular_tach_od" onchange="GLOBAL.pocetInzerceNZ(&quot;nabidka_vozidel_formular&quot;,&quot;tach_od&quot;,&quot;&quot;);" autocomplete="off"> I tried this but that didn't work:
      $oDownloadSamples = _IEGetObjById($oIE, "nabidka_vozidel_formular_tach_od") _IEFormElementSetValue($oDownloadSamples, "123") If you want to try the site I'm working with is https://www.tipcars.cz/. There is a menu on the top left hand side and if you click the "vyhledat" button the input fields will show up.
      Thanks
    • Seminko
      By Seminko
      I am now able to populate the dropdown menus at https://www.tipcars.com/.
      The dropdowns are dynamic and do not have a Text value, only ids.
      Is there a way to get all the available options from a dropdown?
      $url = "https://www.tipcars.com/" $oIE = _IECreate($url) _IELoadWait($oIE) $oDownloadSamples = _IEGetObjById($oIE, "homepage_vyhl_frm_vozidlo") _IEFormElementOptionSelect($oDownloadSamples, "C") Above code, populates ID 'C' into the 'druh' dropdown, which results in selecting 'užitkové'. 
      Is there a way so I can grab all of the options from the dropdown menu? I could easily grab all the IDs but I am afraid they will change in the future so I would much rather match the text titles and assign the option IDs grabbed from site.
      This is what the options are according to Chrome:
      <select class="w1"id="homepage_vyhl_frm_vozidlo"name="homepage_vyhl_frm_vozidlo"onchange="try{NABIDKA_VOZIDEL_FORMULAR.naplnSelectZnacka('homepage_vyhl_frm');GLOBAL.pocetInzerceHZ('homepage_vyhl_frm','vozidlo');}catch(ex){odeslatJsChybu('formHOMEPAGE onChange 1: ' + ex.message, 'formHomePage onChange 1', -1);}"> <option value="A" style="color: black;">osobní a terénní (56 334)</option> <option value="C" style="color: black;">užitkové (4 333)</option> <option value="D" style="color: black;">nákladní (3 742)</option> <option value="E" style="color: black;">autobusy (56)</option> <option value="F" style="color: black;">obytné (373)</option> <option value="G" style="color: black;">přívěsy (1 179)</option> <option value="J" style="color: black;">motorky (780)</option> <option value="S" style="color: black;">pracovní stroje (605)</option> <option value="L" style="color: black;">ostatní (235)</option></select> Also, this cannot be grabbed by _INetGetSource.
      Thanks