Skip to content

Instantly share code, notes, and snippets.

@sovietw0rm
Created December 23, 2016 16:03
Show Gist options
  • Save sovietw0rm/57861b5f60a23c58791eee977a03342b to your computer and use it in GitHub Desktop.
Save sovietw0rm/57861b5f60a23c58791eee977a03342b to your computer and use it in GitHub Desktop.
# coding: utf-8
import requests
from lxml import html
day = 21
month = 12
year = 2016
for i in range(6000):
print i
content = requests.get('http://domains-by-day.com/%d-%d-%d/domains-%d.html' % (year, month, day, i)).text
tree = html.fromstring(content)
domains = tree.xpath('//tr')
if len(domains) < 10:
break
for domain in domains:
temp = domain.xpath('td/a')
#print temp
if len(temp) < 1:
continue
b = temp[0].xpath('text()')
open("domains.txt", "a").write(b[0].lower() + "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment