我試圖建立一個刮板趕上聯賽名稱和odds..Been能趕上的可能性,但匹配兩個似乎不work..here是我的代碼:美麗的湯刮不佳建表
import requests
from bs4 import BeautifulSoup
r = requests.get("http://www.elitebetkenya.com/coupon.php")
soup = BeautifulSoup(r.content)
for i in soup.findAll("tr"):
tds = i.findAll("td")
fixture = soup.findAll("tr", { "class" : "fixture" })
try:
if len(tds[0].text) != 0 :
print " Bet-type: %s, Choice: %s, Match code: %s, 1: %s, 0: %s" % \
(tds[0].text, tds[1].text, tds[2].text,tds[3].text, tds[4].text)
except:
pass
感謝alot..Had重新閱讀美麗的湯文檔來了解您的code..Second一天後,我註冊了這裏,並不能感到更受歡迎...順便說一句,看看我修改你的代碼的方式.. –