#!/usr/bin/env python#-*- coding:utf-8 -*-__author__ = ' Jony ' import Urllib2import timefrom bs4 import beautifulsoupimport sysreload (SYS) Sys.setdefaultencoding (' UTF8 ') def getexpiredate (domain): url = "/HTTP/ tool.chinaz.com/domaindel/?wd= " + domain header = {' User-Agent ' : ' mozilla/5.0 (compatible; msie 9.0; windows nt 6.1; wow64; trident/5.0) '} request = urllib2. Request (Url,none,header) response = urllib2.urlopen (request,None,timeout=30). Read () soup = beautifulsoup (response, "Html.parser", from_encoding= ' Utf-8 ') content = soup.find_all (' div ', attrs={' class ': ' Fr ztcontrig '}) title = ' <tr align= ' center ' ><td>%s</td>\n ' &Nbsp;% domain f = open (' domainexpiredate.html ', ' A + ') f.write (title) time.sleep (2) for div in content: for i in div.strings: table_text = "<td>%s</td>\n" % i f.write (Table_text) f.write (' </tr>\n ') if __name__ == "__main__": with open (' domainexpiredate.html ', ' W ') as DomainExpireDate: head = ' Pyinstaller-f domain_expire.py-i domain.ico-c
You can package your files as exe files.
This article is from the "tireless learning ..." Blog, be sure to keep this source http://jonyisme.blog.51cto.com/3690784/1763942
Python applet gets the expiration time of many domain names