How to Pass Value after superagent Grabs Content?

  node.js, question
'use strict'
 var superagent = require("superagent");
 var cheerio = require('cheerio');
 var express = require('express');
 
 var app = express();
 app.set('view engine', 'ejs');
 
 var htmlContent = '';
 app.get('/', function(req, res1) {
 //htmlContent = '';
 superagent
 .get('http://www.oschina.net/')
 .end(function(err, res) {
 let $ = cheerio.load(res.text, {
 decodeEntities: true
 });
 $('#IndustryNews .p1 a').each((id, element) => {
 let reg = new RegExp("^\/news", "g");
 let reg1 = new RegExp("^\/p", "g");
 let address = $(element).attr('href');
 if (reg.test($(element).attr('href')) || reg1.test($(element).attr('href'))) {
 Address =' http://www.oschina.net' plus $(element).attr('href');
 bracket
 HtmlContent plus = '<a href=\ "'plus address plus' \" target=\"_balank\" >' plus $(element).text () plus' < /a><br><br >';
 
 });
 res1.render('index', {
 'htmlContent': htmlContent,
 });
 });
 // res1.render('index', {
 //    'htmlContent': htmlContent,
 // });
 });
 app.listen(80, function() {
 console.log('Example app listening on port 80!'  );
 });

This procedure is to obtain the news content on the left side of the upper part of oschina.net. The specific questions are as follows:
1. If superagent writes a function inside, how to use htmlContent as the return value of the function?
2. If you still write like this, how will the htmlContent of the callback function be assigned to the outer htmlContent?
3. Can superagent be assigned a variable and then processed? I’ve tried, but after the assignment, the result traversal is all some methods?

I am a beginner, thank you very much

'use strict'
 var superagent = require("superagent");
 var cheerio = require('cheerio');
 var express = require('express');
 var co = require('co');
 
 var app = express();
 app.set('view engine', 'ejs');
 
 function getContent(url) {
 return new Promise((resolve, reject) => {
 let htmlContent = '';
 let v2exContent = '';
 if (url === 'oschina') {
 superagent
 .get('http://www.oschina.net/')
 .end(function(err, res) {
 if (err) {
 reject(err);
 bracket
 let $ = cheerio.load(res.text, {
 decodeEntities: true
 });
 
 $('#IndustryNews .p1 a').each((id, element) => {
 // console.log(element);
 // let $element = $;
 let reg = new RegExp("^\/news", "g");
 let reg1 = new RegExp("^\/p", "g");
 let address = $(element).attr('href');
 if (reg.test($(element).attr('href')) || reg1.test($(element).attr('href'))) {
 Address =' http://www.oschina.net' plus $(element).attr('href');
 bracket
 HtmlContent plus = '<a href=\ "'plus address plus' \" target=\"_balank\" >' plus $(element).text () plus' < /a><br><br >';
 });
 resolve(htmlContent);
 });
 } else {
 superagent
 .get('https://www.v2ex.com/api/topics/hot.json')
 .end(function(err, res) {
 let v2ex = '';
 let arr = JSON.parse(res.text);
 if (res !  = '') {
 
 for (let i = 0;   i < arr.length;  I plus)
 // console.log(arr[i]);
 V2exContent plus = '<a href=\ "'plus arr[i].url plus' \" target=\"_balank\" >' plus arr[i].title plus' < /a><br><br >';
 bracket
 bracket
 resolve(v2exContent);
 });
 bracket
 })
 
 
 bracket
 
 
 app.get('/', function(req, res1) {
 let gen = function*() {
 let c1 = yield getContent('oschina');
 let c2 = yield getContent('v2ex');
 res1.render('index', {
 'htmlContent': c1,
 'v2exContent': c2,
 });
 bracket
 //console.log(htmlContent)
 co(gen).then(() => {
 // console.log('111');
 })
 });
 
 app.listen(80, function() {
 console.log('Example app listening on port 80!'  );
 });