/CrousBot

Primary LanguageJupyter Notebook

CrousBot

crousbot_logo

CrousBot is a bot that helps people get notified if new apartments are being added in trouverunlogement. This bot helps people quickly get a notification to reserve an apartment. This ensures that users can act quickly to secure an apartment.

Installation

  1. Clone the repository:
git clone https://github.com/ImadSaddik/CrousBot.git
cd CrousBot
  1. Install the required libraries:
pip install -r requirements.txt

Usage

To use this bot follow these steps:

  1. Create a .env file in the same directory and fill these values
RECEIVER_EMAIL="receiver_email"
SENDER_EMAIL="sender_email"
SENDER_PASSWORD="smtp_password"

The receiver and sender emails are straightforward to set, but for the password, watch this video to find where to get it from.

  1. Visit the trouverunlogement website, type in the city and click on the search button.

home_screen

  • Copy the url of this page

search_screen

  • Put that url in a variable, you can also track more cities by adding more variables like this:
url_1 = "paste_url"
url_2 = "paste_url"
...
  • Change the locations dictionary accordingly, each url should have a name:
locations = {
    "Strasbourg": url_1,
    "Lingolsheim": url_2,
    ...
}
  1. Run the bot, if you want to decrease the delay, then change it from 60 seconds to a lower value.
logger.info("Starting the scraper")
while True:
    for location, url in locations.items():
        check_for_new_offers(location, url)

    time.sleep(60)

Results

The script will log any offer that it finds in a log file inside the logs directory. If the specified information in the .env file is correct, then the bot will send you an email to let you know that you should take action as quickly as possible.

Here is how the mail looks like:

mail_example

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Contact Information

For support or questions, please contact me at simad3647@gmail.com