Exemplo n.º 1
0
    def get500wwcbf(self, url):
        print("获取500w比赛昨日完场比分数据" + url)
        htmltext = getHtml().getHtml_by_firefox(url)
        soup = BeautifulSoup(htmltext, 'html5lib')

        listtable = soup.find_all(id='table_match')
        list31 = listtable[0].find_all('tr')
        bsxxlist = []
        zqdf = zqconfigClass('').cfg_select()
        li = zqdf.ls.values

        for x in list31:

            id12 = (x.get('id'))
            if id12 == None: continue

            id1 = id12[1:]
            idlist = []
            idlist.append(id1)
            #获取联赛的球队
            listgy = (x.get('gy').split(','))

            if listgy[0] not in li: continue
            if listgy[0].find('女') > -1: continue
            if listgy[0].find('U') > -1: continue
            if listgy[0].find('丙') > -1: continue
            listgy.extend(idlist)
            bsxxlist.append(listgy)

        return bsxxlist
Exemplo n.º 2
0
    def _gethtmlsoup(self, url):
        #500w北单比方情况
        #url="https://live.500.com/zqdc.php"
        #url="https://live.500.com/2h1.php"
        htmltext = getHtml().getHtml_by_firefox(url)

        soup = BeautifulSoup(htmltext, 'html5lib')
        return soup
Exemplo n.º 3
0
    def getqtzqdc(self):
        print("获取球探当日比赛单场数据")
        h = getHtml()
        htmltext = h.getHtml_by_firefox(
            "http://live.win007.com/index2in1.aspx?id=8")
        soup = BeautifulSoup(htmltext, 'lxml')
        #获取主要表格
        ss = soup.find_all('table', id="table_live")

        list2 = []
        for tb in ss[0:2]:
            row = tb.find_all("tr")
            for cell in row:
                cc = cell.find_all('td')
                #去除干扰
                if len(cc) < 2: continue
                i = 0
                list1 = []

                for x in cc:
                    i += 1

                    xstr = x.text
                    if xstr == '选': break
                    if xstr == '': xstr = '-'
                    if cc.index(x) == 9:
                        #print(i,cc.index(x),x)
                        xstr = x.find_all('div', attrs={'class':
                                                        'odds1'})[0].text
                    list1.append(xstr)
                if len(list1) > 1:
                    list2.append(list1)

        #print(list2[1:3])
        #获取配置文件上的比赛列表
        #zqdf=zqconfigClass('').cfg_select()
        #li=zqdf.ls.values
        #
        list5 = []
        for x in iter(list2):
            #提出不需要的比赛
            #if x[1]  not in li:continue
            #if x[5]!='-':continue#未开场
            #if x[9]!='半球':continue#半球
            list4 = []
            list4.append(x[1])
            list4.append(x[4])
            list4.append(x[6])
            list4.append(x[2])
            list4.append(x[5])
            list4.append(x[9])
            list5.append(list4)

        return list5
Exemplo n.º 4
0
 def _gethtmlsoup_oz(self, url):
     htmltext = getHtml().getHtml_by_firefox2(url, 7)
     soup = BeautifulSoup(htmltext, 'html5lib')
     return soup