从豆瓣上找到交通大学站附近一室户的租房帖子

#!/bin/bash
function findUrl() {
    for i in {0,50,100}
    do
      start=$i
      url='https://www.douban.com/group/search?start='$start'&cat=1013&group='$1'&sort=time&q=%E4%BA%A4%E9%80%9A%E5%A4%A7%E5%AD%A6'
      curl $url -s| grep 'title'\
        |grep '交通大学' |grep -v '3/4' |grep -v '1/9' | grep -v '虹桥路' |grep -v '上海影城'\
        | grep -v '闵行' |grep -v '华东师范大学' | grep -v '东川路' \
        | grep -v '两房' |grep -v '两居' |grep -v '两室' | grep -v '三房' \
        |grep -v '次卧'|grep -v '主卧' |grep -v '独卫' \
        | grep -v '洋房'| grep -v '院子'|grep -v '一楼'\
        | grep -v '新天地' | grep -v '上海西站'|grep -v '南翔'\
        |grep -v '求租' | grep -v '女'| grep -v '舍友'
#        | grep -v -E '号线.{3}站'|grep grep -v -E '号线.{2}站'
#      echo $url
    done
}
findUrl 383972
findUrl 146409

 

你可能感兴趣的:(linux,curl,grep)