library(rvest)
library(stringr)
url = 'http://cp.win007.com/buy/toto14.aspx?issueNum=2015004'
session = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(1)") %>% html_text() %>% .[-1]
场次 = session[seq(1,length(session),5)]
event = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(2)") %>% html_text() %>% .[-1]
赛事 = event[seq(1,length(event),4)]
开赛时间 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(3)") %>% html_text() %>% .[-1]
主队 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(4)") %>% html_text() %>% .[-1] %>%
str_replace('\r\n\t\t\t','')
客队 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(5)") %>% html_text() %>% .[-1] %>%
str_replace('\r\n\t\t\t','')
分析 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(12)") %>% html_text() %>% .[-1] %>%
str_replace('\r\n\t\t\t\t','') %>% str_extract("亚 欧 析 统")
状态 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(13)") %>% html_text()
比分 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(14)") %>% html_text()
半场 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(15)") %>% html_text()
彩果 = url %>% html_session() %>% html_nodes("table") %>% .[[2]] %>%
html_nodes("td:nth-child(16)") %>% html_text()
基础信息 = data.frame(场次=场次,赛事=赛事,开赛时间=开赛时间,主队=主队,客队=客队,分析=分析,状态=状态,比分=比分,半场=半场,彩果=彩果)
u = 'http://cp.win007.com/handle/handicap.aspx?issuenum=2015004&typeid=1&companyid=3&1420858993000'
asia = u %>% html() %>% html_nodes("i") %>% html_text() %>% str_split(",") %>% do.call(rbind,.) %>% .[,c(2,4,5,6)] %>% as.data.frame
asia[,1] = as.numeric(asia[,1])
皇冠亚赔 = asia[order(asia[,1]),][-1]
v = 'http://cp.win007.com/handle/1x2.aspx?issuenum=2015004&typeid=1&companyid=9&1420859179000'
uro = v %>% html() %>% html_nodes("i") %>% html_text() %>% str_split(",") %>% do.call(rbind,.) %>% .[,c(2,7,8,9)] %>% as.data.frame
uro[,1] = as.numeric(uro[,1])
威廉欧赔 = uro[order(uro[,1]),][-1]
total = cbind(基础信息,威廉欧赔,皇冠亚赔)
> total
场次 赛事 开赛时间 主队 客队 分析 状态 比分 半场 彩果 V2 V3 V4 V2 V3 V4
8 1 西甲 01-10 03:45 莱万特 拉科鲁 亚 欧 析 统 完场 0-0 0-0 平 2.25 3.00 3.60 0.86 0.25 1.06
3 2 西杯 01-08 03:00 比利亚 社 会 亚 欧 析 统 完场 1-0 0-0 胜 1.73 3.40 4.50 0.91 0.5 0.99
6 3 西杯 01-08 04:00 马竞技 皇 马 亚 欧 析 统 完场 2-0 0-0 胜 1.57 3.50 6.00 0.85 0.75 1.05
7 4 西杯 01-08 05:00 巴伦西 西班人 亚 欧 析 统 完场 2-1 1-0 胜 2.05 3.10 3.60 0.89 0.25 1.01
4 5 西杯 01-08 05:00 阿尔梅 赫塔费 亚 欧 析 统 完场 1-1 0-1 平 2.15 2.90 3.50 0.78 0.25 1.13
5 6 西杯 01-09 03:00 格拉纳 塞维利 亚 欧 析 统 完场 1-2 0-1 负 1.50 3.75 6.50 0.90 0.75 1.00
13 7 西杯 01-09 05:00 巴 萨 埃尔切 亚 欧 析 统 完场 5-0 3-0 胜 1.55 4.00 6.00 0.85 0.75 1.05
14 8 法甲 01-08 03:30 里 尔 伊维恩 亚 欧 析 统 完场 1-0 0-0 胜 3.00 3.20 2.40 0.80 -0.25 1.11
11 9 法甲 01-10 03:30 蒙彼利 马 赛 亚 欧 析 统 完场 2-1 1-0 胜 1.67 3.80 5.00 1.09 1 0.81
9 10 法乙 01-10 03:00 阿雅克 尼 姆 亚 欧 析 统 完场 0-1 0-0 负 2.60 3.00 2.90 0.94 0 0.96
12 11 法乙 01-10 03:00 阿弗尔 沙托鲁 亚 欧 析 统 完场 1-1 0-0 平 4.60 3.30 1.83 1.13 -0.5 0.78
10 12 法乙 01-10 03:00 尼奥尔 阿雅GF 亚 欧 析 统 完场 1-1 0-1 平 1.06 11.00 34.00 1.01 3.25 0.89
1 13 法乙 01-10 03:00 克莱蒙 拉瓦勒 亚 欧 析 统 完场 0-0 0-0 平 1.70 3.40 5.50 0.97 0.75 0.93
2 14 法乙 01-10 03:00 第 戎 图 尔 亚 欧 析 统 完场 0-3 0-1 负 4.00 3.40 1.95 0.86 -0.5 1.04


雷达卡



京公网安备 11010802022788号







