Hello readers, 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 ).
# -*- coding: utf-8 -*-
# Import Modules
# 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, result) # 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