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], '