Hi,
I use un array with 2 values string1 and string2
string1 is outside request (call before request module)
string2 inside request module
How can i get my variable string2 using module request
I try, global, it doesn't work well
Thanks for you help
Eric
...
for (var j = 0, len = arr.length; j < len; j++) {
...
var obj2 = JSON.parse(arr[j]) ;
console.log(obj2.string1 + ' : ' + obj2.string2) ;
// string1 string2 are OK
// string1 is used to build the url, OK
...
request(string1, function (error, response, html) {
// request use string1, OK
if (!error && response.statusCode == 200) {
var $ = cheerio.load(html);
$('td.event-favourite').each(function(i, element){
var a = $(this);
...
var z1 = 'test :' + string2
// string2
string2 contains the last value
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/9d2d3659-0d37-449d-b79f-8184cfdcd3f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.