GithubHelp home page GithubHelp logo

itning / doubanreptile Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 6.0 6.97 MB

豆瓣租房小组多线程爬虫。爬取后自动按时间排序生成markdown文件。

License: Apache License 2.0

Go 99.53% PowerShell 0.47%
reptile fyne xpath douban

doubanreptile's Introduction

豆瓣租房爬虫

GitHub stars GitHub forks GitHub watchers GitHub followers

GitHub issues GitHub license GitHub last commit GitHub release GitHub repo size in bytes HitCount language

下载

https://github.com/itning/DouBanReptile/releases

构建

go build -ldflags="-s -w -H windowsgui" -o ..\bin\main.exe DouBanReptile/cmd

爬取结果文件(markdown)建议使用typora打开

截图

main

main2

a3

a4

markdown

使用教程

确保C:\\Windows\\Fonts\\目录下有simsun.ttc字体文件

e

  1. 如何设置豆瓣群组链接?

    1. 首先搜索某个地区租房,例如:北京租房

      f

    2. 点进去要爬取的某个小组,例如第一个:北京租房

    3. 将页面拉到最下面有个> 更多小组讨论超链接,点进去

      g

    4. 复制地址栏中地址(从/group开始复制到结尾),粘贴到软件设置豆瓣群组链接

      有时候粘贴进软件会崩溃,不知道什么原因,建议把软件中原来的链接删除再粘贴进去。

      h

      i

    5. start=后边的数字50改成%d

      j

    6. 完成

  2. 如何设置排除(包含)关键字?

    排除关键字是标题和内容只要出现关键字就会排除掉该条租房信息。

    例如默认是限女这个关键字,只要租房信息中包含限女生入住只限女生等出现限女关键字的一律不爬。

    多个关键字用|分隔,注意是英文的。

    例如:限女|短租|整租,这三个关键字设置后,只要标题和内容出现这三个关键字软件就不会爬取。

    包含关键字只适用于标题,例如包含关键字为A,标题中含A,但内容中不含,会爬取;内容含A,标题不含,不会爬取。

  3. 关于识别标题中的价格

    使用正则\b\d{4}\b识别标题中的价格信息,无法爬取少于1000元的信息。

  4. 关于爬取结果排序

    先根据价格从小到大排序,价格相同根据发帖时间排序。

  5. 关于爬取结果文件(.md扩展名)如何打开

    建建议下载软件:typora

  6. 如何设置cookie?

    1. 打开豆瓣小组,例如:https://www.douban.com/group/554566/discussion?start=0

    2. F12打开开发者控制台,点击Console控制台选项卡

      cookie1

    3. 输入document.cookie回车,复制内容(注意前后双引号不要复制)

      cookie2

    4. 将复制的内容粘贴在程序中

测试

操作系统 测试结果
windows 7 sp1 OK
windows 10 1909 OK

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.