File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Cricbuzz srapper
2
+
3
+ This python script will scrap cricbuzz.com to get live scores.
4
+
5
+ ## Technologies used:
6
+ - urllib.request
7
+ - BeautifulSoup
8
+
9
+ ## Run the script :
10
+ ``` sh
11
+ $ python3 cric_buzz.py
12
+ ```
Original file line number Diff line number Diff line change
1
+ ''' Python script to get live cricket score
2
+ '''
3
+ from urllib .request import urlopen
4
+ from bs4 import BeautifulSoup
5
+
6
+ URL = 'http://www.cricbuzz.com/cricket-match/live-scores'
7
+ PAGE = urlopen (URL )
8
+ SOUP = BeautifulSoup (PAGE , 'html.parser' )
9
+
10
+ UPDATE = []
11
+
12
+ for score in SOUP .find_all ('div' , attrs = {'class' : 'cb-col cb-col-100 cb-lv-main' }):
13
+ s = score .text .strip ()
14
+ UPDATE .append (s )
15
+
16
+ for i in enumerate (UPDATE ):
17
+ print (i + 1 , UPDATE [i ])
You can’t perform that action at this time.
0 commit comments