Python applet gets the expiration time of many domain names

Source: Internet
Author: User

#!/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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.