URL GOTO RuntimeError (refuses to load a page)

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

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.

URL GOTO RuntimeError (refuses to load a page)

by dance4me on Tue Sep 26, 2017 7:50 am

Hello again to everyone. As I'm beginner in iMacros, I post once more here...

My build is 844 and I'm using Chrome on Windows10.

My problem is I want to modify page number in the adress bar. So I'm trying to modify a get argument and add 1 to it.
Everything turn good for me excepts when I'm trying to call the page at the end. I'm getting a :

RuntimeError: Navigation error occured while loading url http://__undefined__/, details: net::ERR_NAME_NOT_RESOLVED, line: 21

When I'm just trying to modify it manually and push "enter", the new page loads but not when calling my script...


Here is my code :

VERSION BUILD=844 RECORDER=CR
SET !TIMEOUT_PAGE 20
SET !ERRORIGNORE YES
SET !EXTRACT_TEST_POPUP NO

SET !VAR1 {{!URLCURRENT}}
PROMPT {{!VAR1}}
SET !VAR3 EVAL("var s=\"{{!VAR1}}\"; s.match(/page=\d{1,}/);")
'PROMPT {{!VAR3}}
SET !VAR4 EVAL("var s=\"{{!VAR3}}\"; s.match(/\d{1,}/);")
'PROMPT {{!VAR4}}
SET !VAR5 {{!VAR4}}
'PROMPT {{!VAR5}}
ADD !VAR4 1
'PROMPT {{!VAR4}}
SET !VAR6 EVAL("var s='{{!VAR3}}'; s.replace({{!VAR5}},{{!VAR4}});")
'PROMPT {{!VAR6}}
SET !VAR7 EVAL("var s='{{!VAR1}}'; s.replace({{!VAR3}},{{!VAR6}});")
PROMPT {{!VAR7}}
URL GOTO = {{VAR7}}


I have to say that when I'm doing PROMPT {{!VAR7}} , it gives me the correct adress that should normally work :

https://recruteurs.apec.fr/home/consult ... tsCles=AML#liste

instead of

https://recruteurs.apec.fr/home/consult ... tsCles=AML#liste

(page=4 replaced by page=5)

I'm a bit confused cause I feel like I did the right job to get the right string to provide to URL GOTO, but at the end it does not work... Maybe there is something wrong with HTTPs:// ? This link is from a site where I'm logged in. Anyone ever got this kind of problem?

Thanks by advance. Regards!
dance4me
 
Posts: 8
Joined: Mon Sep 25, 2017 7:28 am

Re: URL GOTO RuntimeError (refuses to load a page)

by chivracq on Tue Sep 26, 2017 9:57 am

dance4me wrote:Hello again to everyone. As I'm beginner in iMacros, I post once more here...

My build is
Code: Select all
844 and I'm using Chrome on Windows10.


My problem is I want to modify page number in the adress bar. So I'm trying to modify a get argument and add 1 to it.
Everything turn good for me excepts when I'm trying to call the page at the end. I'm getting a :

RuntimeError: Navigation error occured while loading url http://__undefined__/, details: net::ERR_NAME_NOT_RESOLVED, line: 21

When I'm just trying to modify it manually and push "enter", the new page loads but not when calling my script...


Here is my code :

Code: Select all
VERSION BUILD=844 RECORDER=CR
SET !TIMEOUT_PAGE 20
SET !ERRORIGNORE YES
SET !EXTRACT_TEST_POPUP NO

SET !VAR1 {{!URLCURRENT}}
PROMPT {{!VAR1}}    
SET !VAR3 EVAL("var s=\"{{!VAR1}}\"; s.match(/page=\d{1,}/);") 
'PROMPT {{!VAR3}}
SET !VAR4 EVAL("var s=\"{{!VAR3}}\"; s.match(/\d{1,}/);")
'PROMPT {{!VAR4}}
SET !VAR5 {{!VAR4}}
'PROMPT {{!VAR5}}
ADD !VAR4 1
'PROMPT {{!VAR4}}
SET !VAR6 EVAL("var s='{{!VAR3}}'; s.replace({{!VAR5}},{{!VAR4}});")
'PROMPT {{!VAR6}}
SET !VAR7 EVAL("var s='{{!VAR1}}'; s.replace({{!VAR3}},{{!VAR6}});")
PROMPT {{!VAR7}}
URL GOTO = {{VAR7}}



I have to say that when I'm doing PROMPT {{!VAR7}} , it gives me the correct adress that should normally work :

Code: Select all
https://recruteurs.apec.fr/home/consulter-les-cv/candidapec.html#/rechercheNormale?nbParPage=10&page=5&delaisDisponibilite=200137&lieux=711&motsCles=AML#liste


instead of

Code: Select all
https://recruteurs.apec.fr/home/consulter-les-cv/candidapec.html#/rechercheNormale?nbParPage=10&page=4&delaisDisponibilite=200137&lieux=711&motsCles=AML#liste


(page=4 replaced by page=5)

I'm a bit confused cause I feel like I did the right job to get the right string to provide to URL GOTO, but at the end it does not work... Maybe there is something wrong with HTTPs:// ? This link is from a site where I'm logged in. Anyone ever got this kind of problem?

Thanks by advance. Regards!

=> FCI: iMacros for CR v8.4.4, CR61, Win10.
Always mention your Browser Version as well when you open a Thread, some Commands can get broken from some specific Browser Version...

But yep, normal for your Script, you forgot the '!' for '!VAR7' in "URL GOTO = {{VAR7}}"... :wink:

But, hum..., that's a cumbersome Construction you are using with all those 'EVAL()' Statements and !VAR[1-7], if you simply want to increment the Page Number, ah-ah...!

Here is a much simple Solution for example...:
Code: Select all
'SET !VAR1 {{!URLCURRENT}}
SET !VAR1 https://recruteurs.apec.fr/home/consulter-les-cv/candidapec.html#/rechercheNormale?nbParPage=10&page=4&delaisDisponibilite=200137&lieux=711&motsCles=AML#liste

SET Page_Nb EVAL("var s='{{!VAR1}}'; var x,y,z; x=s.split('&page='); y=x[1].split('&delais'); z=y[0]; z;")
ADD Page_Nb 1
SET New_URL EVAL("var s='{{!VAR1}}'; var x,y,z; x=s.split('&page='); y=x[1].split('&delais'); z=x[0]+'&page='+'{{Page_Nb}}'+'&delais'+y[1]; z;")

PROMPT VAR1:<BR>_{{!VAR1}}_<BR><BR>Page_Nb:<SP>_{{Page_Nb}}_<BR><BR>New_URL:<BR>_{{New_URL}}_
PAUSE
URL GOTO={{New_URL}}
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10_x64.)

And it could be done in just one single 'EVAL()' Statement, I deliberately chose for 2 to be able to prompt the new Page_Nb... And this is only one Solution, there are many different ways to get what you want...
- (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: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: URL GOTO RuntimeError (refuses to load a page)

by dance4me on Wed Sep 27, 2017 1:23 am

First of all, thank you very much, my error was so dumb that I couldn't see it for an hour...

Secondly, my version of Google Chrome is 60.0.3112.113 (Build officiel) (64 bits). I apologize for not mentioning it.

Thirdly, thanks for taking time to show me another way to code it. :-)

May I ask why you add "z;" at the end of each eval() statement?

May I be greedy enough to ask you if my unsolved question I posted in another thread about function declaration in an EVAL() is allowed?

Thank you very much for your help and have a great day!
dance4me
 
Posts: 8
Joined: Mon Sep 25, 2017 7:28 am

Re: URL GOTO RuntimeError (refuses to load a page)

by chivracq on Wed Sep 27, 2017 5:44 am

dance4me wrote:First of all, thank you very much, my error was so dumb that I couldn't see it for an hour...

Secondly, my version of Google Chrome is 60.0.3112.113 (Build officiel) (64 bits). I apologize for not mentioning it.

Thirdly, thanks for taking time to show me another way to code it. :-)

May I ask why you add "z;" at the end of each eval() statement?

May I be greedy enough to ask you if my unsolved question I posted in another thread about function declaration in an EVAL() is allowed?

Thank you very much for your help and have a great day!

Hum..., OK for CR60, mine updated itself silently from CR60 to CR61 without asking me anything, so I took for granted that CR61 was being pushed to all CR Users... (I don't use CR myself, I only gave in to install it last week because of some other Thread specific to CR and iMacros for CR.)

Well, I always use "z;" at the end of "my" 'EVAL()' Statements as I often use some 'x,y,z' Temp Vars for (intermediary) Calculations/Manipulations and "z;" at the end makes sure it is clear which Result is being returned. And if that 'EVAL()' Statement needs to be debugged, I simply need to change the Return Var to "x;" or "y;" to be able to check (with the same 'PROMPT') if those intermediary Statements are already correct without the Need to "maintain" several "parallel" 'EVAL()' Statements until the final one works correctly...
And this Construction allowed me in my Script for example to reuse practically the same 'EVAL()' Statements for 'Page_Nb' and 'New_URL' by more or less simply changing a "y[0]" to "y[1]" while they both return a completely different Content...

Euh, yep, I saw your Thread about the Function in 'EVAL()', I thought you wouldn't need it anymore as you already found/have a Solution with this current one... But, hum..., I'm no JavaScript Guru, I don't use any JS Functions, I only use some Basic Functionality for Data Manipulation on Numbers/Strings/Arrays...
- (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: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 5 guests

-->