我想在以下网站上为每个游戏抓取团队网格:
http://mc.championdata.com/nrl/
我相信以下代码适用于客队:
<div class="cd6364_component cd6364_div_away_team_single" style="width: 100%;
我该怎么刮这个网站?
我是初学者,但我想我得到了你要求的东西。你可以使用BeautifulSoup和Requests在python中完成它。像这样的东西:
from bs4 import BeautifulSoup
from urllib.request import urlopen
quote_page = "http://mc.championdata.com/nrl"
page = urlopen(quote_page)
soup = BeautifulSoup(page, "html.parser")
# Take out the <div> of name and get its value
name_box = soup.find("")
#for example: soup.find("a", {"class": "price", "data-usd": True})['data-usd']
我完全不明白你在寻找什么。