Python automatically collects domain name whois information. __python

Source: Internet
Author: User

Previously wrote a socket based, but often to connect different WHOIS servers, some information is not complete.

This is directly based on the Chinese webmaster Network, because the target page has JS dynamic operation, so can only use the PAM module.


Here is an introduction:


Bar each line one of the write script in the program directory of the Dns.txt, and then run the following script.

The program automatically generates a separate HTM file for each domain and places it in the same directory.

Pam and BeautifulSoup Reference my blog can find

BeautifulSoup Download:

http://blog.csdn.net/yatere/article/details/7241033

Pam Downloads:

http://sourceforge.net/projects/pamie/files/PAMIE/PAM3.0%20for%20Python%203.0/


Import Pam,sys,time,os from
bs4 import beautifulsoup
url= ' http://whois.chinaz.com/' path=sys.path[0]+ '
\ '
ie=pam. Pamie ()
ipl=open (path+r ' dns.txt ') readlines ()
no=1 for
i in IPL:
    Os.system (R ' rasdial 3m Pppoe_user Pppoe_pass ') # 3m is a dial-up connection name, followed by a less user password query can be annotated out of the bank
    I=i.strip ()
    ie.navigate (url+i)
    Soup=beautifulsoup ( Ie.outerhtml ())
    a=soup.findall (' div ', {' class ': ' Div_whois '})
    print (a[1], ' 

Related Article

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.