以下脚本在我的 NodeJS 服务器中运行良好,但当我尝试抓取一些西里尔文网站时,它很少返回这样的响应。
脚本
x(url, {
name: 'title',
ogDescription: 'meta[property="og:description"]@content',
metaDescription: 'meta[name="description"]@content',
ogImage: 'meta[property="og:image"]@content',
twitterImage: 'meta[name="name="twitter:image:src""]@content',
metaImage: 'meta[name="image"]@content',
headImage: 'head img@src',
contentImage_1: '.content img@src',
contentImage_2: '.image img@src'
})
(function (err, obj) {
var firstData = {
name: [
obj.name
],
description: [
obj.metaDescription,
obj.ogDescription,
],
image: [
obj.ogImage,
obj.twitterImage,
obj.metaImage,
obj.headImage,
obj.contentImage_1,
obj.contentImage_2
]
}
编码不正确的响应示例
firstData { name: [ '(Rock, Pop) [15LP] [24/96] Queen - Studio Collection - 2015,
FLAC (tracks) :: RuTracker.org' ],
description:
[ 'RuTracker.org » ���������� ��� (����������� ���������) »
������� ������� (Rock, Pop) [15LP] [24/96] Queen -
Studio Collection - 2015, FLAC (tracks)',
undefined ],
image: [ undefined, undefined, undefined, undefined, undefined, undefined ] }
我该如何解决?