Ein Python-basierter Bot, der automatisch auf neue Anzeigen auf kleinanzeigen.de reagiert ideal z.B. für heiß begehrte Artikel. Sobald eine passende Anzeige erscheint, wird automatisch eine Nachricht an den Anbieter gesendet.
- Python 3.11 (empfohlen)
chromedriver(installiert in deinem virtuellen Environment)- Ein Chrome-Profil mit aktivem Login bei Kleinanzeigen
-
Repository klonen:
git clone https://github.com/dein-user/kleinanzeigen-bot.git cd kleinanzeigen-bot -
Virtuelle Umgebung erstellen:
python3.11 -m venv venv source venv/bin/activate -
Abhngigkeiten installieren:
pip install -r requirements.txt
-
Version prüfen:
Öffne Chrome und rufechrome://settings/helpauf – notiere dir die Version. -
Passenden Chromedriver herunterladen:
→ https://chromedriver.chromium.org/downloads -
Entpacken und lokal speichern:
unzip chromedriver_mac64.zip mv chromedriver ./venv/bin/ chmod +x ./venv/bin/chromedriver
Erstelle eine Datei .env im Projektverzeichnis (Beispiel: siehe .env.example):
EMAIL=dein@mail.de
PASSWORD=deinpasswort
MESSAGE_TEXT=Hi, ich habe Interesse! :)
CHROME_PROFILE_PATH=/Users/deinname/path/zum/chrome-profile
SEARCH_URL=https://www.kleinanzeigen.de/s-bender-statue/k0
BLACKLIST=fake,brokenFalls du dein aktives Chrome-Profil nur fr den Bot verwenden mchtest, gehe so vor:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--user-data-dir="/tmp/kleinanzeigen-profile" \
--profile-directory=Default-
Melde dich im geffneten Chrome bei Kleinanzeigen an.
-
Schliee Chrome.
-
Kopiere das Profil in dein Projektverzeichnis:
cp -R /tmp/kleinanzeigen-profile ./chrome-profile
-
Trage den Pfad in deiner
.envein:CHROME_PROFILE_PATH=/Users/deinname/deinprojektverzeichnis/chrome-profile
python api.pypython scraper.pyWenn eine passende Anzeige erscheint, wird:
- berprft, ob sie bereits bekannt ist
- auf Blacklist gefiltert
- und automatisch
messenger.pymit der Anzeigen-URL aufgerufen
-
Wenn du den Bot im unsichtbaren Headless-Modus nutzen möchtest, kannst du in
messenger.pyin der Funktionsetup_driver()die Zeileoptions.headless = False
durch
options.add_argument("--headless=new")
ersetzen.
kleinanzeigen-bot/
api.py # Flask-Server fr Kommunikation
scraper.py # Sucht regelmig nach neuen Anzeigen
messenger.py # Sendet Nachricht ber Chrome
.env # Konfiguration (nicht in Git!)
.env.example # Beispielkonfiguration
requirements.txt # Python-Abhngigkeiten
seen_ads.txt # Bereits gesichtete Anzeigen
ignored_ads.txt # Anzeigen, die durch Blacklist gefiltert wurden
chrome-profile/ # Gespeichertes Chrome-Profil mit Login
README.md
- Verwende den Bot verantwortungsvoll.
- Kleinanzeigen.de kann automatisierten Zugriff ggf. blockieren nutze Pausenintervalle und keine zu aggressive Frequenz.
- Projekt dient als Lern- und Automatisierungshilfe, keine Garantie auf Erfolg oder dauerhafte Funktionalitt.
- Benutzer-Login über Eingabe statt
.env - Mehrfach-Absendeschutz
- Frontend-UI zur Verwaltung
- Erweiterte blacklist/ignore Logik
Georg | github.com/patchwork-lab
A Python-based bot that automatically responds to new listings on kleinanzeigen.de – ideal for highly sought-after tickets. As soon as a suitable listing appears, a message is automatically sent to the seller.
- Python 3.11 (recommended)
chromedriver(installed in your virtual environment)- A Chrome profile with an active login on Kleinanzeigen
-
Clone the repository:
git clone https://github.com/dein-user/kleinanzeigen-bot.git cd kleinanzeigen-bot -
Create a virtual environment:
python3.11 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Check your Chrome version:
Open Chrome and go tochrome://settings/help– note the exact version. -
Download the matching Chromedriver:
→ https://chromedriver.chromium.org/downloads -
Unzip and place inside your venv:
unzip chromedriver_mac64.zip mv chromedriver ./venv/bin/ chmod +x ./venv/bin/chromedriver
Create a .env file in the project directory (example: see .env.example):
EMAIL=your@mail.com
PASSWORD=yourpassword
MESSAGE_TEXT=Hi, I'm interested! :)
CHROME_PROFILE_PATH=/Users/yourname/path/to/chrome-profile
SEARCH_URL=https://www.kleinanzeigen.de/s-bender-statue/k0
BLACKLIST=fake,brokenIf you want to use your active Chrome profile only for the bot, proceed as follows:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--user-data-dir="/tmp/kleinanzeigen-profile" \
--profile-directory=Default-
Log in to Kleinanzeigen in the opened Chrome window.
-
Close Chrome.
-
Copy the profile to your project directory:
cp -R /tmp/kleinanzeigen-profile ./chrome-profile
-
Enter the path in your
.envfile:CHROME_PROFILE_PATH=/Users/yourname/yourprojectdirectory/chrome-profile
python api.pypython scraper.pyWhen a suitable listing appears, the bot:
- Checks whether it's already known
- Filters based on blacklist
- and automatically calls
messenger.pywith the listing URL
-
If you want to use the bot in invisible headless mode, open
messenger.pyand change this line in thesetup_driver()function:options.headless = False
to
options.add_argument("--headless=new")
kleinanzeigen-bot/
api.py # Flask server for communication
scraper.py # Regularly searches for new listings
messenger.py # Sends message via Chrome
.env # Configuration (not in Git!)
.env.example # Example configuration
requirements.txt # Python dependencies
seen_ads.txt # Already seen listings
ignored_ads.txt # Listings filtered by blacklist
chrome-profile/ # Saved Chrome profile with login
README.md
- Use the bot responsibly.
- Kleinanzeigen.de may block automated access – use pause intervals and avoid aggressive frequency.
- This project is intended as a learning and automation aid, no guarantee of success or permanent functionality.
- User login via input instead of
.env - Multiple send protection
- Frontend UI for management
- Extended blacklist/ignore logic
Georg | github.com/patchwork-lab