Skip to content

Instantly share code, notes, and snippets.

@managedkaos
Created July 31, 2017 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save managedkaos/3e4cfda45452682575c5b5d1fc3e186d to your computer and use it in GitHub Desktop.
Save managedkaos/3e4cfda45452682575c5b5d1fc3e186d to your computer and use it in GitHub Desktop.
A python script to scrape the status metrics from https://status.github.com/
import requests
from bs4 import BeautifulSoup
# make a request for the data
r = requests.get('https://status.github.com/')
# convert the response text to soup
soup = BeautifulSoup(r.text, "lxml")
# get all the divs with the "graph" class
for graph in soup.find_all("div", {"class":"graph"}):
# from the graph div, get all the divs with the "data" class
for data in graph("div", {"class":"data"}):
# from the data div, grab the h2 and span
h2 = data("h2")[0]
span = data("span")[0]
# print the report for this metric
print "%-40s %s" % (h2.string, span.string)
@managedkaos
Copy link
Author

Github Status Page in HTML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment