Skip to content

no-fish-ball/renthouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

租房信息爬取

目前采集的是豆瓣租房小组的帖子

执行

  1. 准备工作
a. 修改config/config.py文件的配置,添加变量
* https://www.douban.com/group/sweethome/,其中豆瓣的组ID为"sweethome"
* {city}是填写你需要采集的城市

eg:
# put 豆瓣的组ID here
{city}_groups = [
    "beijingzufang",
    "zhufang",
    "sweethome",
    "opking",
]

# set yourself location keywords
{city}_locations = [
    "学院路地铁口",
]

# set yourself house type
{city}_house = ["一室"]



b. 修改app.py, main中传递的是需要采集的city
if __name__ == '__main__':
    douban.main("beijing")
    # douban.main("shanghai")

  1. 启动采集
  • 如果使用docker启动
# 构建镜像
./debug_build.sh 

(重构镜像时可使用:./debug_build.sh --build)

# 容器内执行
./start.sh
./debug_build.sh 

(重构镜像时可使用:./debug_build.sh --build)
  • 直接启动
# 安装依赖
pip install -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# 开始采集
./start.sh
  1. 采集后的文件保存在了 /tmp 目录下

About

豆瓣租房信息采集

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors