亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

phpsir 開發(fā) 一個檢測百度關(guān)鍵字網(wǎng)站排名的python 程序

 更新時間:2009年09月17日 13:43:36   作者:  
一個檢測百度關(guān)鍵字網(wǎng)站排名的python 程序 phpsir 開發(fā)
源碼如下 :保存成utf-8 bd.py 文件
復(fù)制代碼 代碼如下:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import urllib ,urllib2
import re
def baidu(w):
url= "http://www.baidu.com/s?"
values = {
"w":w.encode('gbk','ignore')
}
data = urllib.urlencode(values)
newurl = url + data
response = urllib2.urlopen(newurl)
the_page = response.read().decode('gbk','ignore')
return the_page

def ana(data,mysite):
o = re.compile("href=\"(.+?)\"")
f = o.findall(data)
line = 1
for ff in f:
if not re.search("baidu",ff) and not re.search("^s\?",ff) and re.search("^http:\/\/",ff):
if re.search(mysite,ff):
print "* " ,line ,ff
else:
print line ,ff
line += 1

if __name__ == "__main__":
mysite = sys.argv[2]
data = baidu(sys.argv[1].decode('utf-8'))
ana(data,mysite)

用法 python bd.py "關(guān)鍵字" 我的域名部分 :
例:
復(fù)制代碼 代碼如下:

python bd.py "vbs" "jb51.net"

相關(guān)文章

最新評論