https://www.cnblogs.com/liuchuanfeng/p/6686009.html

    1. let request = require('request');
    2. let options = {
    3. url: '',
    4. headers: {
    5. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'
    6. }
    7. };
    8. function callback(error, response, body) {
    9. if (!error && response.statusCode == 200) {
    10. let info = JSON.parse(body);
    11. console.log(response.statusCode + " Stars");
    12. } else {
    13. console.log(response.statusCode + " Stars2");
    14. }
    15. }
    16. let urlArr = [
    17. 'http://data.cma.cn/data/cdcdetail/dataCode/NOCV_SURF_CLI_GLB_MUL_DAY.html',
    18. 'http://tipex.data.cma.cn/tipex/expeditionData/id/3.html']
    19. options.url ='http://data.cma.cn/data/cdcdetail/dataCode/NOCV_SURF_CLI_GLB_MUL_DAY.html'
    20. request(options, callback);