|
@@ -155,16 +155,24 @@ public class OddsPortal extends ParserBase implements ParserJoinedFunctions {
|
|
|
|
|
|
|
|
List<WebElement> subDivs = element.findElements(By.xpath("./div"));
|
|
List<WebElement> subDivs = element.findElements(By.xpath("./div"));
|
|
|
|
|
|
|
|
- if (subDivs.size() == 2) {
|
|
|
|
|
|
|
+ WebElement firstResultsDiv;
|
|
|
|
|
+ if (subDivs.size() == 3) {
|
|
|
WebElement competitionsDiv = subDivs.get(0);
|
|
WebElement competitionsDiv = subDivs.get(0);
|
|
|
List<WebElement> links = competitionsDiv.findElements(By.xpath(".//a"));
|
|
List<WebElement> links = competitionsDiv.findElements(By.xpath(".//a"));
|
|
|
countryId = getCountryId(links);
|
|
countryId = getCountryId(links);
|
|
|
leagueId = getLeagueId(links);
|
|
leagueId = getLeagueId(links);
|
|
|
result.setLeagueId(leagueId);
|
|
result.setLeagueId(leagueId);
|
|
|
result.setCountryId(countryId);
|
|
result.setCountryId(countryId);
|
|
|
|
|
+
|
|
|
|
|
+ firstResultsDiv = subDivs.get(2).findElement(By.xpath("./a"));
|
|
|
|
|
+ } else if (subDivs.size() == 1) {
|
|
|
|
|
+ firstResultsDiv = subDivs.get(0).findElement(By.xpath("./a"));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ System.out.println("No games found!");
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- WebElement firstResultsDiv = element.findElement(By.xpath("./a"));
|
|
|
|
|
|
|
+// WebElement firstResultsDiv = element.findElement(By.xpath("./a"));
|
|
|
|
|
|
|
|
setGameDate(result, firstResultsDiv);
|
|
setGameDate(result, firstResultsDiv);
|
|
|
|
|
|
|
@@ -233,7 +241,8 @@ public class OddsPortal extends ParserBase implements ParserJoinedFunctions {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void setOdds(ResultDTO result, WebElement firstResultsDiv) {
|
|
private void setOdds(ResultDTO result, WebElement firstResultsDiv) {
|
|
|
- List<WebElement> oddsDivs = firstResultsDiv.findElements(By.xpath("./div/div"));
|
|
|
|
|
|
|
+ //List<WebElement> oddsDivs = firstResultsDiv.findElements(By.xpath("./div/div"));
|
|
|
|
|
+ List<WebElement> oddsDivs = firstResultsDiv.findElements(By.xpath("./parent::*/div"));
|
|
|
try {
|
|
try {
|
|
|
result.setOdds1(Float.parseFloat(oddsDivs.get(1).getText()));
|
|
result.setOdds1(Float.parseFloat(oddsDivs.get(1).getText()));
|
|
|
result.setOddsX(Float.parseFloat(oddsDivs.get(2).getText()));
|
|
result.setOddsX(Float.parseFloat(oddsDivs.get(2).getText()));
|
|
@@ -249,7 +258,8 @@ public class OddsPortal extends ParserBase implements ParserJoinedFunctions {
|
|
|
|
|
|
|
|
private void setScoring(ResultDTO result, WebElement firstResultsDiv) {
|
|
private void setScoring(ResultDTO result, WebElement firstResultsDiv) {
|
|
|
// String resultPath = "./div/div/div[2]/div/div/div/div/div";
|
|
// String resultPath = "./div/div/div[2]/div/div/div/div/div";
|
|
|
- String resultPath = "./div/div/div[1]/div[2]/div/div/div/div/div";
|
|
|
|
|
|
|
+ //String resultPath = "./div/div/div[1]/div[2]/div/div/div/div/div";
|
|
|
|
|
+ String resultPath = "./div/div[2]/div/div/div/div/div";
|
|
|
|
|
|
|
|
if (checkIfElementExists(firstResultsDiv, resultPath)) {
|
|
if (checkIfElementExists(firstResultsDiv, resultPath)) {
|
|
|
List<WebElement> scoringDivs = firstResultsDiv.findElements(By.xpath(resultPath));
|
|
List<WebElement> scoringDivs = firstResultsDiv.findElements(By.xpath(resultPath));
|