shell批量采集百度下拉词

 时间:2026-02-17 17:05:13

1、# 接口

https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=关键词

测试下:

https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=seo

可以用

shell批量采集百度下拉词

2、# 测试

# curl -s "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=seo"

shell批量采集百度下拉词

3、# 编码有点问题,换编码

curl -s "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=seo"|iconv -f gbk -t utf-8

# iconv -f gbk -t utf-8 是把gbk换成utf-8的,如果没有编码问题就不用替换。

shell批量采集百度下拉词

4、#提取关键词-初步提取

curl -s "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=seo"|iconv -f gbk -t utf-8|awk -F":" '{print $4}'

# awk -F":" '{print $4}' 意思指数以“:”为分隔符,取第四项。

shell批量采集百度下拉词

5、#提取关键词-正则提取

curl -s "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=seo"|iconv -f gbk -t utf-8|awk -F":" '{print $4}'|grep -oP '(?<=").*?(?=")'

shell批量采集百度下拉词

6、# 去掉 ,

curl -s "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=seo"|iconv -f gbk -t utf-8|awk -F":" '{print $4}'|grep -oP '(?<=").*?(?=")'|sed 's/,//g'

shell批量采集百度下拉词

1、汇总下:批量采集

cat keywords.txt|while read line;do curl -s "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd="$line|iconv -f gbk -t utf-8|awk -F":" '{print $4}'|grep -oP '(?<=").*?(?=")'|sed 's/,//g';done

# keywords.txt  一行一词 utf-8

shell批量采集百度下拉词

2、# 存入1.txt

cat keywords.txt|while read line;do curl -s "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd="$line|iconv -f gbk -t utf-8|awk -F":" '{print $4}'|grep -oP '(?<=").*?(?=")'|sed 's/,//g';done > 1.txt

  • 新惊天动地的技能阶级数据资料
  • 防止网站被挂马的五个有效方法
  • 日期和int类型的相加减
  • 如何声明HTML5
  • Win7IE浏览器收藏夹无法点击怎么办?
  • 热门搜索
    秀丽的近义词是什么 眼皮肿了怎么快速消肿 口臭是怎么引起的 移动的宽带怎么样 扫一扫脸型配发型 构思的近义词 营销方案怎么写 欣喜若狂的近义词 怎么剪辑歌曲 脸上黄褐斑怎么办