Wednesday, 22 June 2016

Python : Python Script to Update and Show "ESPNCRICINFO.COM" live Scores.


Python Script to Update and Show "ESPNCRICINFO.COM" live Scores.

A small python script for automatically updating and show espncricinfo.com scores of live cricket matches after a particular time.

import requests
from bs4 import BeautifulSoup
from time import sleep
url = "http://static.espncricinfo.com/rss/livescores.xml"
while True:
r = requests.get(url)
while r.status_code is not 200:
r = requests.get(url)
soup = BeautifulSoup(r.text)
data = soup.find_all('description')
score = data[1].text
print(soup.text)
sleep(60)


I hope this tutorial will surely help you. If you have any questions or problems please let me know.


Happy Hadooping with Patrick..

No comments:

Post a Comment