From cc3ca7c3affe95c87723e228e0806c3d69e048b2 Mon Sep 17 00:00:00 2001 From: Divy Ranjan Date: Sat, 6 Oct 2018 12:03:57 +0530 Subject: [PATCH 1/2] Create cricbuzz_scrap.py --- CricBuzz_Score_Update/cricbuzz_scrap.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 CricBuzz_Score_Update/cricbuzz_scrap.py diff --git a/CricBuzz_Score_Update/cricbuzz_scrap.py b/CricBuzz_Score_Update/cricbuzz_scrap.py new file mode 100644 index 0000000..af06e21 --- /dev/null +++ b/CricBuzz_Score_Update/cricbuzz_scrap.py @@ -0,0 +1,20 @@ +from urllib.request import urlopen +from bs4 import BeautifulSoup + +quote_page = 'http://www.cricbuzz.com/cricket-match/live-scores' +page = urlopen(quote_page) +soup = BeautifulSoup(page,'html.parser') + +update=[] + +for score in soup.find_all('div',attrs={'class':'cb-col cb-col-100 cb-lv-main'}): + s=score.text.strip() + update.append(s) + +print('-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*') + + +for i in range(len(update)): + print(i+1), + print(update[i]) +print('-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*') From b7a35ff04d0d8f7409ba2941b7841dd3c1375fc4 Mon Sep 17 00:00:00 2001 From: Divy Ranjan Date: Sat, 6 Oct 2018 12:04:30 +0530 Subject: [PATCH 2/2] Added README.md --- CricBuzz_Score_Update/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 CricBuzz_Score_Update/README.md diff --git a/CricBuzz_Score_Update/README.md b/CricBuzz_Score_Update/README.md new file mode 100644 index 0000000..509f390 --- /dev/null +++ b/CricBuzz_Score_Update/README.md @@ -0,0 +1,14 @@ +# Cric-Update +This python script, based on web scraping, fetches the score of the recent cricket matches using Beautiful soup library to scrape the data. + + +# How to run + +Type in this command in terminal. + + python3 cricbuzz_scrap.py + +It will display score updates of all the recent matches. + +![](https://d2mxuefqeaa7sj.cloudfront.net/s_78DB49E0B4D273EF775E6D44076B0924AC39C7C9CAE0AA84C9E4F68389263AD8_1532542514744_Screenshot+from+2018-07-25+23-43-29.png) +