Coder Social home page Coder Social logo

zufang_crawler's Introduction

zufang_crawler

项目背景:

因作者最近想换房子住,但是工资微薄只能等有优惠的特价房字,又不想每天通过租房app去找一遍,想让他自己推送到邮箱,下班路上看。

功能介绍:

本项目是通过爬取某家和某爱某家的网站的租房信息页,读取照片、标题、价格等关键信息并通过邮件推送的方式实现绕过烦人的中介找到心仪的房子。

步骤:

1.下载代码到本地

git pull https://github.com/vision1234/zufang_crawler.git

2.使用浏览器进入某家和某爱某家的网站,设置好筛选条件,复制url替换对应.py上的url

https://bj.5i5j.com/zufang/subway/ss2159/b4000e7300h110l70r2r3t1u1/ 
https://bj.lianjia.com/ditiezufang/li656s43137676/rt200600000001l1l2ra2ra3ra4brp4000erp7300/

3.修改send_mail.py发件人邮箱和授权码,授权码可以从邮箱运营商网站获取

my_sender = '[email protected]'  # 发件人邮箱账号
my_pass = "xxxxxxx"  # 口令

mail_sc.png

4.昵称改不改都可以

msg['From'] = formataddr(["666", my_sender])  # 括号里的对应发件人邮箱昵称、发件人邮箱账号
msg['To'] = formataddr(["666", u])  # 括号里的对应收件人邮箱昵称、收件人邮箱账号

5.修改main.py的收件人邮箱

send_mail.mail("[email protected]", mail_data)

mail_sc.png

6.在命令行安装python库(python3.8)

pip install -r requirements.txt

低版本的话,需要依次手动安装arrow、lxml、requests这三个库

7.运行main.py

python mian.py

8.可以在crontab 中添加定时任务,每天定时跑一遍

0 18 * * * cd /home/user_name/workspace/zufang_crawler;python mian.py;

zufang_crawler's People

Contributors

vision1234 avatar

Watchers

 avatar

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.