Sign inSign up

vel7an/wbmbot_v2

By vel7an

•Updated over 2 years ago

Python bot that auto-applies to flats on WBM. Configurable.

Image
1

2.8K

vel7an/wbmbot_v2 repository overview

Docker Pulls Docker Image Size

GitHub commit activity GitHub repo size GitHub forks GitHub Repo stars

GitHub Actions Workflow Status GitHub Actions Workflow Status GitHub Actions Workflow Status

Code Format

GitHub Release

Alt

⁠WBMBOT_v2

An improved work-in-progress (WIP) and fully refactored version of the original [WBMBOT by David Fischer](https://github.com/fischer-hub/wbmbot).

WBMBOT_v2 is a Selenium-based Python bot designed to automate the application process for new flats listed by WBM Wohnungsbaugesellschaft Berlin-Mitte GmbH. It prioritizes speed and efficiency to ensure your application is among the first 1000 considered in the random selection process for apartment viewings.

⁠Prerequisites

  • Python 3.10 or higher

⁠Installation

To set up your environment and install the required dependencies, run the following command:

pip install -r wbmbot_v2/requirements.txt

⁠Quick Start

To launch the bot, navigate to the project directory and execute:

python3 wbmbot_v2/main.py

On the first run, the bot will guide you through a setup process to gather necessary information for applications on wbm.de. This data will be stored in a local configs/wbm_config.json file in a human-readable format.

Security Notice: The information is saved unencrypted. Ensure the security of your configs/wbm_config.json file.

Alternatively, you can manually create the configs/wbm_config.json file with the following structure:

⁠Configuration File Example
{
    "first_name": "JOHN",
    "last_name": "DOE",
    "sex": "m",
    "emails": [
        "[email protected]",
        "[email protected]"
    ],
    "notifications_email": "[email protected]",
    "street": "Doner-Str. 123",
    "zip_code": "12345",
    "city": "Berlin",
    "phone": "4911223344",
    "wbs": "yes",
    "wbs_date": "23/04/1972",
    "wbs_num": "WBS 160",
    "wbs_rooms": "2",
    "wbs_special_housing_needs": "no",
    "filter": ["wbs", "2-zimmer", "2 zimmer", "2 zim", "2-zim"]
}

⁠Notifications (E-mails)

The bot will be able to send you e-mail notifications once it applies for a flat from the e-mail you input in notifications_email within the config.

To do so, you need to export EMAIL_PASSWORD to your environment variables. If this variable is not found, no e-mails will be sent.

NOTE: If your email has 2FA (MFA), you need to create an App Password from your Outlook online settings.

NOTE: Only @outlook.com emails are currently supported

export EMAIL_PASSWORD=<password>

⁠Outputs

You will get outputs such as:

  • Angebote HTML page (Entire HTML page) saved under offline_viewings/angebote_pages if ANY flats are found
  • EXPOSE PDF saved under offline_viewings/apartments_expose_pdfs if the bot applies to a flat

All of these files are saved per bot page-check. e.g. if the angebote page has at least 1 flat, everytime the bot wants to check that page it will download under a nested folder with date and time as its name.

Remember to do a clean-up if you don't want to view them!

⁠Command-Line Interface

usage: main.py [-i INTERVAL] [-H] [-t]

A Selenium-based bot that scrapes 'WBM Angebote' page and auto applies on appartments based on user exclusion filters

options:
  -h, --help            show this help message and exit
  -i INTERVAL, --interval INTERVAL
                        Set the time interval in 'minutes' to check for new flats (refresh) on wbm.de. [default: 3 minutes]
  -H, --headless        If set, use 'headless' run. The bot will run in the background, otherwise, a chrome tab will show.
  -t, --test            If set, run test-run on the test data. This does not actually connect to wbm.de.

⁠Docker

⁠Build
docker build -f ci/docker/Dockerfile -t wbmbot_v2 .
⁠Pull
docker pull vel7an/wbmbot_v2:latest
⁠Run

If running for the first time, use -it to setup your config, if you already have the config ready in the correct directory, use -d

If you want to send emails as well to yourself as notifications, please add -e "EMAIL_PASSWORD=<password>" to the command

⁠Without e-mail notifications
docker run -it \
    -v /PATH_HERE/offline_viewings:/home/offline_viewings \
    -v /PATH_HERE/logging:/home/logging \
    -v /PATH_HERE/configs:/home/configs \
    vel7an/wbmbot_v2:latest
⁠With e-mail notifications
docker run -it \
    -e "EMAIL_PASSWORD=<password>" \
    -v /PATH_HERE/offline_viewings:/home/offline_viewings \
    -v /PATH_HERE/logging:/home/logging \
    -v /PATH_HERE/configs:/home/configs \
    vel7an/wbmbot_v2:latest

⁠Filtering Strategy

The filter list is designed to exclude listings based on specified keywords. Simply add your exclusion keywords to the list.

⁠Logging

Successful applications are recorded in logging/successful_applications.json.

Important: This log prevents reapplication to the same flats. DO NOT DELETE it unless you intend to re-apply to all available flats.

⁠Additional Information

During setup, you can provide multiple email addresses. The bot will apply to each flat once per email address. By default, the bot refreshes wbm.de every 3 minutes to check for new listings.

As of now, there are no timeouts, bot checks, or captchas on the website (which we hope remains the case). However, given the limited number of flats available, frequent checks are not deemed necessary compared to platforms like immoscout24.

Embark on your apartment hunt with WBMBOT_v2. Good luck!

Tag summary

Content type

Image

Digest

sha256:17ea22c9a…

Size

391.1 MB

Last updated

over 2 years ago

docker pull vel7an/wbmbot_v2