|
|
@@ -244,9 +244,24 @@ public class OddsPortal extends ParserBase implements ParserJoinedFunctions {
|
|
|
List<WebElement> oddsDivs = firstResultsDiv.findElements(By.xpath("./div/div"));
|
|
|
//List<WebElement> oddsDivs = firstResultsDiv.findElements(By.xpath("./parent::*/div"));
|
|
|
try {
|
|
|
- result.setOdds1(Float.parseFloat(oddsDivs.get(0).getText()));
|
|
|
- result.setOddsX(Float.parseFloat(oddsDivs.get(1).getText()));
|
|
|
- result.setOdds2(Float.parseFloat(oddsDivs.get(2).getText()));
|
|
|
+
|
|
|
+ float odds1 = Float.parseFloat(oddsDivs.get(0).getText());
|
|
|
+ float oddsX = Float.parseFloat(oddsDivs.get(1).getText());
|
|
|
+ float odds2 = Float.parseFloat(oddsDivs.get(2).getText());
|
|
|
+
|
|
|
+ if (odds1 < 1 || odds1 >= 100) {
|
|
|
+ odds1 = convertAmericanOddsToDecimal(odds1);
|
|
|
+ }
|
|
|
+ if (oddsX < 1 || oddsX >= 100) {
|
|
|
+ oddsX = convertAmericanOddsToDecimal(oddsX);
|
|
|
+ }
|
|
|
+ if (odds2 < 1 || odds2 >= 100) {
|
|
|
+ odds2 = convertAmericanOddsToDecimal(odds2);
|
|
|
+ }
|
|
|
+
|
|
|
+ result.setOdds1(odds1);
|
|
|
+ result.setOddsX(oddsX);
|
|
|
+ result.setOdds2(odds2);
|
|
|
} catch (NumberFormatException e) {
|
|
|
// Skip this one
|
|
|
} catch (IndexOutOfBoundsException e) {
|