Back Command Not Executing

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Back Command Not Executing

by Keyne on Thu Jun 01, 2017 4:35 pm

1. iMacros version 11.5.498.2403
2. Windows 10
3. iMacros browser
4. Yes
5. Yes
6. Potentially...

I coded a .vbs to handle some scraping while on a 10.x version earlier in the year. I then took a multi-month hiatus after the evaluation period expired. I recently purchased into the above version and attempted to rerun my macro...

The macro essentially navigates to a page, scrapes somethings, clicks a hyperlink, scrapes some more things, and then tries to back up one pages to click the next link. Scrape, link, scrape, back, scrape, link, scrape back, ad infinitum through the parent site and all of its children links.

The back part is probably the simplest part of the whole process, but is no longer functioning correctly. It was originally coded in the .vbs as...

iret = imacros.iimPlay("back")

..."back" being the name of a .iim file (in the correctly targeted macro directory) who simply contains the iMacros command 'BACK'.

I also attempted...

iret = imacros.iimPlayCode("BACK")

...to no avail.

The .vbs does not crash, it continues on to the next part of the process, but then aborts when it does not find the things it expects to find and gets kicked out of the main program and encounters the close command.

This could conceivably be site specific (the target is the collection of webpages that constitute StarCityGames.com's decklist repository), as I cut out everything from my .vbs except the web nav part and the back command, as follows...

Option Explicit

Dim imacros, iret, loopexit, cardid, playerid, objFS, objEventSource, strLine, processedind, eventtype, eventlevel, eventlevelselector, startdate, enddate, year, date, location, format, metadata, metadatagroupname, decklistfilename, sideboardexists, maindeckendpoint
Set imacros = CreateObject("imacros")
iret = imacros.iimInit("", False)

iret = imacros.iimSet("url", "www.google.com")
iret = imacros.iimPlay("navigatetourl")
WScript.Sleep 4000

iret = imacros.iimSet("url", "www.amazon.com")
iret = imacros.iimPlay("navigatetourl")
WScript.Sleep 4000

iret = imacros.iimPlay("BACK")
WScript.Sleep 4000

...which ran successfully, and as intended (navigating to Google, then Amazon, then back to Google, before stopping.)

I would be willing to email the entire body of the .vbs for troubleshooting, if that is a service that is offered as part of my service contract.

Let me know if anything else is needed to service this issue. Thank you in advance!
Keyne
 
Posts: 1
Joined: Thu Jun 01, 2017 4:03 pm

Re: Back Command Not Executing

by chivracq on Fri Jun 02, 2017 7:49 am

Keyne wrote:
Code: Select all
1. iMacros version 11.5.498.2403
2. Windows 10
3. iMacros browser
4. Yes
5. Yes
6. Potentially...


I coded a .vbs to handle some scraping while on a 10.x version earlier in the year. I then took a multi-month hiatus after the evaluation period expired. I recently purchased into the above version and attempted to rerun my macro...

The macro essentially navigates to a page, scrapes somethings, clicks a hyperlink, scrapes some more things, and then tries to back up one pages to click the next link. Scrape, link, scrape, back, scrape, link, scrape back, ad infinitum through the parent site and all of its children links.

The back part is probably the simplest part of the whole process, but is no longer functioning correctly. It was originally coded in the .vbs as...
Code: Select all
iret = imacros.iimPlay("back")

..."back" being the name of a .iim file (in the correctly targeted macro directory) who simply contains the iMacros command 'BACK'.

I also attempted...
Code: Select all
iret = imacros.iimPlayCode("BACK")

...to no avail.

The .vbs does not crash, it continues on to the next part of the process, but then aborts when it does not find the things it expects to find and gets kicked out of the main program and encounters the close command.

This could conceivably be site specific (the target is the collection of webpages that constitute StarCityGames.com's decklist repository), as I cut out everything from my .vbs except the web nav part and the back command, as follows...

Code: Select all
Option Explicit

Dim imacros, iret, loopexit, cardid, playerid, objFS, objEventSource, strLine, processedind, eventtype, eventlevel, eventlevelselector, startdate, enddate, year, date, location, format, metadata, metadatagroupname, decklistfilename, sideboardexists, maindeckendpoint
Set imacros = CreateObject("imacros")
iret = imacros.iimInit("", False)

iret = imacros.iimSet("url", "www.google.com")
iret = imacros.iimPlay("navigatetourl")
WScript.Sleep 4000

iret = imacros.iimSet("url", "www.amazon.com")
iret = imacros.iimPlay("navigatetourl")
WScript.Sleep 4000

iret = imacros.iimPlay("BACK")
WScript.Sleep 4000


...which ran successfully, and as intended (navigating to Google, then Amazon, then back to Google, before stopping.)

I would be willing to email the entire body of the .vbs for troubleshooting, if that is a service that is offered as part of my service contract.

Let me know if anything else is needed to service this issue. Thank you in advance!

Hum, I don't use the iMB nor the Scripting Interface but your Pb sounds indeed Web-Site specific to me...
- I guess you've tested that from that specific Page where you want to fire the 'BACK', that "it works" if you do it manually from the Browser, without iMacros... (= not from a Macro...)? (Sorry for asking "stupid" Qt's (I hope...!), but my "Experience" is that I can better ask those "stupid" Qt's, ah-ah...!)
Some Sites/Pages prevent leaving the Page with a "Session expired" or some "The page is asking you to confirm you want to leave - data you have entered may not be saved. <Leave Page> <Stay on Page>" Popup Msg, your Macro might then need some 'ONDIALOG' Command to handle it...

- From the specific Page, have you tried running that mini 'BACK' Macro "manually" & "standalone" from the iMacros Side Panel...?

- You could check the 'iret' ReturnCode for the 'iimmPlay()' or 'iimPlayCode()' Command...

A Workaround for 'BACK' and more reliable than using 'BACK' in my Opinion (this is the "Method" I use myself in all my Macros, I don't use a single 'BACK') is to use a 'URL GOTO' instead to force your Script to navigate (back) to that previous Page... :idea:

>

Concerning sending your whole Script to TechSupport, I guess you can always do that, you've got some Email Address mentioned in the 'Forum Rules' where you found the [1-6] Qt's about FCI and Required Info to include in your Post...
And I guess you can even open a Ticket with TechSupport directly with your Support License...
(But sending a Mail to the Address mentioned above will actually as well automatically open a Case/Ticket for you, I think..., at least it works like that for me (but I'm not sure if that "Feature" is enabled for "everybody"...), and you may have to send your Mail from the Address you registered with..)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 3 guests

-->