赞
踩
- qq:850103945
- if (ObjectUtil.equal(page.getUrl().toString(), CrawlingAddressConstant.URL1)) {
- List<FootballMatchDO> footballMatchList = new ArrayList<>();
- List<Selectable> nodes = html.css(".bet-date-wrap").nodes();
- for (int i = 1; i <= nodes.size(); i++) {
- Selectable selectableDate = html.xpath("//*[@id='relativeContainer']//*[@class='bet-date-wrap'][" + (i + 1) + "]");
- Selectable selectableTable = html.xpath("//*[@id='relativeContainer']//*[@class='bet-tb-dg'][" + i + "]");
- List<Selectable> tr = selectableTable.css("tr").nodes();
- int index = 0;
- for (int j = 0; j < tr.size(); j++) {
- String match = tr.get(j).css(".bet-tb-tr .td-evt a", "text").toString();
- String number = tr.get(j).css(".bet-tb-tr .td-no a", "text").toString();
- if (StrUtil.isBlank(match) && StrUtil.isBlank(number)) {
- continue;
- }
- index += 2;
- FootballMatchDO footballMatch = new FootballMatchDO();
- footballMatch.setStartTime(selectableDate.css(".bet-date", "text").get());
- footballMatch.setNumber(number);
- footballMatch.setMatch(match);
- String color = tr.get(j).xpath("//*[@class='td-evt']/a/@style").toString();
- footballMatch.setColor(color.substring(color.indexOf("#"), color.length() - 1));
- footballMatch.setOpenTime(tr.get(j).css(".td-endtime", "text").toString());
- footballMatch.setHomeTeam(tr.get(j).css(".td-team .team-l i", "text").toString() + tr.get(j).css(".td-team .team-l a", "text").toString());
- footballMatch.setVisitingTeam(tr.get(j).css(".td-team .team-r i", "text").toString() + tr.get(j).css(".td-team .team-r a", "text").toString());
- footballMatch.setLetBall(tr.get(j).css(".td-rang .itm-rangA2", "text").toString());
- footballMatch.setNotLetOdds(StrUtil.join(",", tr.get(j).css(".itm-rangB1 .betbtn span:first-child", "text").all()).replaceAll(",↑", "").replaceAll(",↓", ""));
- footballMatch.setLetOdds(StrUtil.join(",", tr.get(j).css(".itm-rangB2 .betbtn span:first-child", "text").all()).replaceAll(",↑", "").replaceAll(",↓", ""));
- footballMatch.setIsSingle((tr.get(j).css(".td-rang .itm-rangA1 .ico-dg", "text").toString()) != null || (tr.get(j).css(".td-rang .itm-rangA2 .ico-dg", "text").toString()) != null ? "1" : "0");
- footballMatch.setHalfWholeOdds(StrUtil.join(",", html.xpath("/html/body/div[6]/div/div[3]/table[" + i + "]/tbody/tr[" + index + "]/td/div/table[1]/tbody/tr/td/p/i/text()").all()).replaceAll(",↑", "").replaceAll(",↓", ""));
- footballMatch.setScoreOdds(StrUtil.join(",", html.xpath("/html/body/div[6]/div/div[3]/table[" + i + "]/tbody/tr[" + index + "]/td/div/table[2]/tbody/tr/td/p/i/text()").all()).replaceAll(",↑", "").replaceAll(",↓", ""));
- footballMatch.setGoalOdds(StrUtil.join(",", html.xpath("/html/body/div[6]/div/div[3]/table[" + i + "]/tbody/tr[" + index + "]/td/div/table[3]/tbody/tr/td/p/i/text()").all()).replaceAll(",↑", "").replaceAll(",↓", ""));
- footballMatch.setDeadline(LotteryAlgorithmUtil.calculationDeadline(footballMatch.getOpenTime(), footballMatch.getStartTime()));
- footballMatch.setCreateTime(new Date());
- footballMatch.setUpdateTime(new Date());
- footballMatchList.add(footballMatch);
- }
- }
- page.putField("footballGoalList", footballMatchList);

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。