Created
October 12, 2016 22:03
-
-
Save gkio/4622385a39bd8257838a51f78c23e152 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
casper.then(function() { | |
this.click('div.table-main table:nth-child(1) tbody tr:nth-child(1) td.team-home'); | |
this.waitForPopup(/match/, function(){ | |
console.log('popup opened') | |
}); | |
this.withPopup(/match/, function(){ | |
this.capture('popup.png') | |
this.waitForSelector("#default-odds", function(){ | |
var matchOdds = this.evaluate(getOdds); | |
matches.push(matchOdds); | |
this.click('#li-match-standings a') | |
}); | |
this.waitForSelector("#table-type-1", function(){ | |
this.capture('tables.png') | |
var tableGeneral = this.evaluate(matchTableGeneral); | |
matches.push(tableGeneral); | |
this.click('li#tabitem-table-home a'); | |
}); | |
this.waitForSelector("#table-type-2", function(){ | |
this.capture('дом.png') | |
var tableHome = this.evaluate(matchTableGeneral); | |
this.echo(JSON.stringify(tableHome)) | |
matches.push(tableHome); | |
this.click('li#tabitem-table-home a'); | |
}); | |
this.waitForSelector("#table-type-3", function(){ | |
console.log('data') | |
this.capture('дом.png') | |
var tableHome = this.evaluate(matchTableGeneral); | |
this.echo(JSON.stringify(tableHome)) | |
matches.push(tableHome); | |
// this.click('li#tabitem-table-home a'); | |
}); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment