目录

Rental Bot

This repository contains a small Telegram bot that scrapes several Dutch rental websites.

Requirements

  • Python 3.9 or newer

Setup

  1. Install dependencies:
    pip install -r requirements.txt
  2. Set the following environment variables before running the bot:
    • TELEGRAM_TOKEN – Telegram bot token.
    • TELEGRAM_CHAT_ID – one or more chat IDs (comma separated) to receive notifications.
    • CITY – city to search (e.g. Apeldoorn).
    • PRICE_RANGE – price range, e.g. 0-1500.

Running the bot

Execute:

python main.py

Running tests

Use pytest to run the unit tests:

pytest

Offline development

Sample HTML and JSON files for each scraper are available in tests/data/. These are snapshots of actual pages from the various rental sites. You can use them to develop and test the scrapers offline and to experiment with extracting additional fields.

关于
15.2 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号