用Shell提取百度搜狗下拉框词

2036

#!/bin/bash百度网页
for key in cat keyword.txt
do
url=”http://suggestion.baidu.com/su?wd=”$key”&p=3&cb=window.bdsug.sug&sid=1432_4634_4261_4686&t=1387868353412″
cokies=”BAIDUID=665D96A99E5786C1E56F5686F4483109:FG=1;NBID=68505506741EE2E3F8FD3EC0DFA92E7D:FG=1;H_PS_PSSID=1432_4634_4261_4686″
curl -b “$cokies” “$url”|iconv -f gbk -t utf-8|grep -oP ‘(?<=”).*?(?=”)’|egrep -v “baidu|,”;done

搜狗下拉框:http://w.sugg.sogou.com/sugg/ajaj_json.jsp?key=SEO&type=web&ori=yes&pr=web&abtestid=&ipn=

360下拉框:http://sug.so.360.cn/suggest/word?callback=suggest_so&encodein=utf-8&encodeout=utf-8&word=SEO

发表评论