Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ks6849 committed Sep 30, 2021
0 parents commit 56ae46c
Show file tree
Hide file tree
Showing 9 changed files with 2,187 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
452 changes: 452 additions & 0 deletions innings1.html

Large diffs are not rendered by default.

363 changes: 363 additions & 0 deletions innings2.html

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const url = "https://www.espncricinfo.com/series/ipl-2020-21-1210595";
const request = require("request");
const cheerio = require("cheerio");

let scoreCardObj = require("./scoreCard");
request(url, cb);

function cb(err, res, html) {
if (!err) {
let searchTool = cheerio.load(html);
let link = searchTool(".widget-items.cta-link a");
let fullLink = "https://www.espncricinfo.com" + link.attr("href");
// console.log(fullLink);
request(fullLink, allMatchPageCb);
}
}

function allMatchPageCb(err, res, html) {
if (!err) {
let $ = cheerio.load(html);
let allScoreCardLink = $('a[data-hover="Scorecard"]');
// console.log(allScoreCardLink.length);
let count = 0;
for(let i=0 ; i<allScoreCardLink.length ; i++){
let link = $(allScoreCardLink[i]).attr("href");
let fullAllMatchLink ="https://www.espncricinfo.com"+link;
// console.log("https://www.espncricinfo.com"+link);
scoreCardObj.processSingleMatch(fullAllMatchLink)
}
console.log("```````````````````````````````````");
}
}
814 changes: 814 additions & 0 deletions match.html

Large diffs are not rendered by default.

Loading

0 comments on commit 56ae46c

Please sign in to comment.