Showing
1 changed file
with
8 additions
and
4 deletions
| 1 | -var cheerio = require("cheerio") | 1 | +var cheerio = require('cheerio'); |
| 2 | -var request = require("request") | 2 | +var request = require('request'); |
| 3 | 3 | ||
| 4 | var url="http://www.melcon.com/chart/"; | 4 | var url="http://www.melcon.com/chart/"; |
| 5 | 5 | ||
| 6 | request(url, function(error, response, html) | 6 | request(url, function(error, response, html) |
| 7 | { | 7 | { |
| 8 | - const $ = cheerio.load(html) | 8 | + var $ = cheerio.load(html); |
| 9 | + | ||
| 10 | + var arr=$('.ellipsis rank01'); | ||
| 11 | + console.log(arr[0].children[0].attribs.title); | ||
| 12 | + | ||
| 13 | +}) | ||
| 9 | 14 | ||
| 10 | -}) | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment