Skip to content

Instantly share code, notes, and snippets.

@hybridjosto
Created January 20, 2018 18:46
Show Gist options
  • Save hybridjosto/7e44f43a43849842d3cc4a69addfd15b to your computer and use it in GitHub Desktop.
Save hybridjosto/7e44f43a43849842d3cc4a69addfd15b to your computer and use it in GitHub Desktop.
import urllib3
from bs4 import BeautifulSoup
from dateutil import parser
my_date = '26/05/2016'
dt = parser.parse(my_date)
url_to_scrape = "http://www.analogman.com/kotdelay.htm"
http = urllib3.PoolManager()
r = http.request('GET', url_to_scrape)
soup = BeautifulSoup(r.data,"html.parser")
ps = soup.find_all('b')
for p in ps:
x = parser.parse(p.string)
print dt - x
print dt, x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment