Created
December 23, 2016 16:03
-
-
Save sovietw0rm/57861b5f60a23c58791eee977a03342b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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