How To Create Live Score Scraper/Finder (Sports) Using Python - | python web scraping | python example- part 9

 Hello Friends,


                           This is our ninth part of web scraping tutorials. and in this tutorial, I am gonna to show you how to create live score finder or you can say score scrapper script using python . but if you are new visitor then first check our index or For Eight Part Click Here

So,  Let's Talk About Today's Topic,

For This Purpose We Will Use http://static.cricinfo.com website because this website is giving data in XML format free-of-cost.

and from previous tutorials, you already experienced  that XML is really very simple , easy to use and very helpful for creating API.

So, Let's Start.

Here, I am Sharing My Demo Codes But If You Want More Better Example Then, You Can Modify these codes yourself or Download This Script From My GitHub repository (link given at the end of these codes ).


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Written By:
#       S.S.B
#       surajsinghbisht054@gmail.com
#       bitforestinfo.blogspot.com
#   
# Import Modules
import urllib2
import re

# Downloading Live Score XML Code From Website and reading also
xml_data = urllib2.urlopen('http://static.cricinfo.com/rss/livescores.xml').read()

# Pattern For Searching Score and link
pattern = "<item>(.*?)</item>"

# Finding Matches
for i in re.findall(pattern, xml_data, re.DOTALL):
    result = re.split('<.+?>',i)
    print (result[1], result[3]) # Print Score

Warning I am Creating This Tutorial Only For Practise and Educational Purpose. I will not Take any type of responsibility about any illegal activities.

For Downloading, Raw Script Click Here


In Our Future Tutorials, we will try to create youtube video downloader, email harvester , Amazon product details scraper and many other scripts also. 

For More Update, Visit Our Regularly. 
And Subscribe Our Blog, 

Follow Us and share it.
For Any Type of Suggestion Or Help
Contact me:
S.S.B
surajsinghbisht054@gmail.com

Share this

Related Posts

Previous
Next Post »