javascript: assign to a variable the content of a webpage (AWS)

Hi, I’m trying to assign the content of a webpage to a variable , UD2 in my case, but I’m not able. I should write on aws shadow that content but I’m able just to write in cloudwatch logs. Is there anyone that can help me? I report my code. Thanks, Eleonora

<pre>

console.log(‘Loading function’);
var aws = require(‘aws-sdk’);

var endpoint = ‘’;
var thingName = ‘’;

exports.handler = function(event, context) {

var https = require(“https”);

var querystring = “https://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&APPID=123”;

https.get(encodeURI(querystring), function(res) {
console.log("Got response: " + res.statusCode);
res.setEncoding(‘utf8’);
res.on(‘data’, function(d) {

console.log('Body: ’ + d);
return d;
});
context.succeed(res.statusCode);
// console.log(res);
return res;

}).on(‘error’, function(e) {
console.log("Got error: " + e.message);
context.fail(e.message);

});

var iotdata = new aws.IotData( { endpoint: endpoint } );
var params = { thingName: thingName };
iotdata.getThingShadow(params, function (err, data) {

if (!err) {

var payload = JSON.parse(data.payload);
var currentUD1 = payload.state.desired.UD1;
var currentUD2 = payload.state.desired.UD2;
console.log("Current state : " + currentUD2);
// console.log("body: " +body);
var desiredUD2;
if(currentUD1 == 1) {

desiredUD2 = https.get.d;
console.log(desiredUD2);

}
else {

desiredUD2=https.get.d;
console.log(desiredUD2);

}

var desiredState = {
state: {
desired: {

UD2:https.get.d
},
reported: {

UD2:https.get.d

}
}
};

var params = {
thingName: thingName,
payload: JSON.stringify(desiredState)
};
iotdata.updateThingShadow(params, function (err, data) {
if (!err) {
context.succeed();
} else {
context.fail(err);
}
});
} else {
context.fail(err);
}
});
};

</pre>