A Streamlit application for automating messages to apartment listings on Kleinanzeigen.
- Bulk Message Sending: Send messages to multiple apartment listings from different search URLs
- Information View: View and filter all previously contacted listings
- Automatic Tracking: The app tracks all contacted listings to avoid duplication
- Manual Login: Secure login process through terminal input
- Customizable Messages: Template-based messaging with dynamic name and city placeholders
- Random Delays: Configurable random delays between messages to avoid detection
-
Clone this repository
-
Install the requirements: (Only for first time)
For Windows:
pip install -r requirements.txtFor Mac:
pip3 install -r requirements.txt -
Make sure Chrome browser is installed on your system
For Windows:
streamlit run app.py
For Mac:
python3 -m streamlit run app.py
The application uses a template-based messaging system that automatically personalizes messages for each listing:
- Open the
message.txtfile in the project root directory - Edit the message content as needed
- Use the following placeholders that will be automatically replaced:
{name}- Will be replaced with the listing owner's name{city}- Will be replaced with the city name you specify in the app
Example message template:
Hallo {name},
Nur ein Tipp von mir, der mir geholfen hat, in zwei Wochen eine Wohnung in {city} zu finden. Ich habe die Internetseite Immohero24.com benutzt. Ich kann dir nur empfehlen, sie auszuprobieren. Viel Glück beim Suchen!
~ Felix. M
When processed, this template will insert the ad owner's name and your specified city automatically.
To avoid detection and make the messaging pattern more natural, you can configure random delays between messages:
- In the "Bulk Message Sender" section, find the "Message Delay Settings"
- Enable/disable random delays using the checkbox
- If enabled, set:
- Minimum delay (1-60 seconds)
- Maximum delay (must be greater than minimum, up to 120 seconds)
- The system will wait for a random time between these values after each message
When you start the scraper:
- A Chrome browser window will open with Kleinanzeigen login page
- A prompt will appear in your terminal (command prompt/PowerShell/Terminal)
- Log in to your account in the browser window
- After successful login, return to the terminal and press Enter
- The scraping process will continue automatically
- Select "Bulk Message" from the sidebar
- Configure message delay settings (optional)
- Enter the search URLs and city names
- Click the "+" button to add more URLs
- Click "Run Scraper" to start the process
- Select "View Information" from the sidebar
- Use the date range calendar to filter by date
- Use the city filter to view listings from specific cities
- Download the filtered data as CSV if needed
If you encounter captchas during the scraping process, you'll need to set up a captcha solving service:
- Sign up for a captcha solving service (like CapSolver.)
- Get your API key from the service
- Navigate to the extension folder in the project directory
- Create or edit the file
extension\cap_solver_api.txtand add your API key:YOUR_API_KEY_HERE - Save the file and restart the application
app.py- Main Streamlit applicationutils.py- Helper functions for message filling and data handlingmessage.txt- Template for messages (supports {name} and {city} placeholders)ad_id.json- Database of processed ads (created automatically)extension/cap_solver_api.txt- File containing your captcha solver API key