1 Star 0 Fork 1

Jeremy Lee/Python-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cricket_live_score.py 469 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jérôme Krell 提交于 2019-10-10 14:22 . Reformat Code by PyCharm-Community
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
my_url = "http://www.cricbuzz.com/"
Client = uReq(my_url)
html_page = Client.read()
Client.close()
soup_page = soup(html_page, "html.parser")
score_box = soup_page.findAll("div", {"class": "cb-col cb-col-25 cb-mtch-blk"})
score_box_len = len(score_box)
print(score_box_len)
for i in range(score_box_len):
print(score_box[i].a["title"])
print(score_box[i].a.text)
print()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Jelmy/Python-1.git
[email protected]:Jelmy/Python-1.git
Jelmy
Python-1
Python-1
master

搜索帮助