0
var getMatches = function(){
var sait = 'https://www.website.com'
request({ url: sait, jar: true}, function(error, response, html){
if(!error){
var $ = cheerio.load(html)
var count = ($('.TheMatch').length)
for(var i = 2; i< count + 2 ; i++){
var live = ($('.TheMatch:nth-child('+i+') .LiveStatus').text())
var nameMatch = ($('.TheMatch:nth-child('+i+') .MDxEventName').text())
var time = ($('.TheMatch:nth-child('+i+') .DateTime').text().substring(8))
var websiteCount = ($('.TheMatch:nth-child('+i+') .TotalBookies').text())
if((websiteCount >= 25) && (live.length === 0)){
console.log('match ' + nameMatch)
console.log('count Websites ' + websiteCount)
}
}}})}
我想在此网站上进行身份验证并保存cookie我该怎么做?并保存饼干,所以每次我解析不需要登录?使用节点js使用身份验证报废网站
回答更新。 –
我得到这个错误,不能找到工作人员http://s9.postimg.org/80ea6tr7j/Screen_Shot_2016_03_15_at_10_03_47_PM.png –
因为它是从我的项目复制/粘贴。即使我为您提供了99%的所需,作为开发人员,您自己也应该修复非常简单的错误。 self.sessionId和worker.sessionId是相同的东西,只需将其更改为var sessionId; –