Code Monkey home page Code Monkey logo

vel-san / wbmbot_v2 Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 2.0 939 KB

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

Home Page: https://hub.docker.com/r/vel7an/wbmbot_v2

License: MIT License

Python 97.62% Dockerfile 2.38%
apartment-finder automation bot python3 selenium docker wbm berlin

wbmbot_v2's Introduction

wbmbot_v2's People

Contributors

fischer-hub avatar vel-san avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wbmbot_v2's Issues

[BUG] "Details" or "Ansehen" button not iterating properly when applying to several apartments

Describe the bug
If the bot finds several flats on the page that match your requirements, it will attempt to apply to them 1 by 1. The problem here is that once it is done applying to the first flat, it goes back to the main page "Angebote" page.

It fails to jump to the second flat button with "flat_elem" getting stale, because the page was refreshed! But the "flat_obj" is properly updated.

The bug is really simple to fix but I just cannot fix it properly if there are no flats available to test it out ๐Ÿ˜ข

To Reproduce
Attempt to apply on 2 flats, 2nd flat will fail (to be precise, it will apply to the first flat twice instead of apply to both)

Expected behavior
Should apply to all flats 1 by 1

Screenshots
N/A

Environment

  • OS: Linux + Docker
  • Version: Doesn't matter;

Additional context
Related bug lines:

flat_elem (Fails to update as intended and is always taking the first element in the list):

flat_obj (Works properly, updates its values as intended):

Bot Crashes: Install lxml[html_clean] or lxml_html_clean directly.

Describe the bug
Bot crashes when there is an apartment on WBM Site. It tries to restart itself then crash again

To Reproduce
Just run the bot, one customisation i did was to set interval to 1 mionute

Expected behavior
Bot should not crash and apply for the apartment

Screenshots
Screenshot 2024-04-29 at 4 00 45โ€ฏPM

Environment

  • MAC OS 14.4.1

Additional context
[29.04.2024 - 15:54] [main.py:71] [INFO] Initializing Script (v1.1.4) (Headless? False) ๐Ÿš€
[29.04.2024 - 15:54] [main.py:76] [INFO] Checking for internet connection ๐Ÿ”Ž
[29.04.2024 - 15:54] [main.py:84] [SUCCESS] Online ๐ŸŸข
[29.04.2024 - 15:54] [io_operations.py:24] [INFO] Loading WBM config โš™๏ธ
[29.04.2024 - 15:54] [main.py:107] [INFO] Connecting to 'https://www.wbm.de/wohnungen-berlin/angebote/' ๐Ÿ”—
[29.04.2024 - 15:54] [webDriverOperations.py:252] [SUCCESS] Cookies have been accepted ๐Ÿช
[29.04.2024 - 15:54] [webDriverOperations.py:380] [INFO] Looking for flats ๐Ÿ‘€
[29.04.2024 - 15:54] [webDriverOperations.py:387] [SUCCESS] Found 2 flat(s) in total ๐Ÿ’ก
[29.04.2024 - 15:54] [main.py:122] [ERROR] Bot has crashed... Attempting to restart it now! โค๏ธโ€๐Ÿฉน
[29.04.2024 - 15:54] [main.py:125] [ERROR] Crash reason: lxml.html.clean module is now a separate project lxml_html_clean.
Install lxml[html_clean] or lxml_html_clean directly.
^CTraceback (most recent call last):
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 111, in main
webDriverOperations.process_flats(
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/helpers/webDriverOperations.py", line 391, in process_flats
hpd.save_viewing_offline(
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/httpsWrapper/httpPageDownloader.py", line 30, in save_viewing_offline
save_webpage(
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pywebcopy/init.py", line 107, in save_page
page = config.create_page()
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pywebcopy/configs.py", line 241, in create_page
from .core import WebPage
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pywebcopy/core.py", line 12, in
from .elements import HTMLResource
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pywebcopy/elements.py", line 24, in
from .parsers import iterparse
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pywebcopy/parsers.py", line 14, in
from lxml.html.clean import Cleaner
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/lxml/html/clean.py", line 18, in
raise ImportError(
ImportError: lxml.html.clean module is now a separate project lxml_html_clean.
Install lxml[html_clean] or lxml_html_clean directly.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 134, in
main()
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 129, in main
main()
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 129, in main
main()
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 129, in main
main()
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 127, in main
time.sleep(5)
KeyboardInterrupt

[BUG] Bot Unable to detect flat size

Describe the bug
Bot ignores the apartment as users set limit is something greater than 0. Bot detects the apartment size as 0 m2

To Reproduce
Run the bot when apartment is available

Screenshots
Screenshot 2024-04-29 at 4 24 11โ€ฏPM

Environment
MAC OS - 14.4.1

Additional context
[29.04.2024 - 16:17] [main.py:76] [INFO] Checking for internet connection ๐Ÿ”Ž
[29.04.2024 - 16:17] [main.py:84] [SUCCESS] Online ๐ŸŸข
[29.04.2024 - 16:17] [io_operations.py:24] [INFO] Loading WBM config โš™๏ธ
[29.04.2024 - 16:17] [main.py:107] [INFO] Connecting to 'https://www.wbm.de/wohnungen-berlin/angebote/' ๐Ÿ”—
[29.04.2024 - 16:17] [webDriverOperations.py:252] [SUCCESS] Cookies have been accepted ๐Ÿช
[29.04.2024 - 16:17] [webDriverOperations.py:380] [INFO] Looking for flats ๐Ÿ‘€
[29.04.2024 - 16:17] [webDriverOperations.py:387] [SUCCESS] Found 2 flat(s) in total ๐Ÿ’ก
[29.04.2024 - 16:17] [webDriverOperations.py:438] [WARNING] Ignoring flat '3-ZIMMER WOHNUNG IN MITTE WBS 140' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:17] [webDriverOperations.py:438] [WARNING] Ignoring flat '2-ZIMMER-WOHNUNG IN MITTE WBS 160/180/220' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:17] [webDriverOperations.py:61] [ERROR] Failed to switch page, last page reached โŒ
[29.04.2024 - 16:18] [webDriverOperations.py:504] [INFO] Reloading main page ๐Ÿ”„
[29.04.2024 - 16:18] [webDriverOperations.py:380] [INFO] Looking for flats ๐Ÿ‘€
[29.04.2024 - 16:18] [webDriverOperations.py:387] [SUCCESS] Found 2 flat(s) in total ๐Ÿ’ก
[29.04.2024 - 16:18] [webDriverOperations.py:438] [WARNING] Ignoring flat '3-ZIMMER WOHNUNG IN MITTE WBS 140' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:18] [webDriverOperations.py:438] [WARNING] Ignoring flat '2-ZIMMER-WOHNUNG IN MITTE WBS 160/180/220' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:18] [webDriverOperations.py:61] [ERROR] Failed to switch page, last page reached โŒ
[29.04.2024 - 16:19] [webDriverOperations.py:504] [INFO] Reloading main page ๐Ÿ”„
[29.04.2024 - 16:19] [webDriverOperations.py:380] [INFO] Looking for flats ๐Ÿ‘€
[29.04.2024 - 16:19] [webDriverOperations.py:387] [SUCCESS] Found 2 flat(s) in total ๐Ÿ’ก
[29.04.2024 - 16:19] [webDriverOperations.py:438] [WARNING] Ignoring flat '3-ZIMMER WOHNUNG IN MITTE WBS 140' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:19] [webDriverOperations.py:438] [WARNING] Ignoring flat '2-ZIMMER-WOHNUNG IN MITTE WBS 160/180/220' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:20] [webDriverOperations.py:61] [ERROR] Failed to switch page, last page reached โŒ
[29.04.2024 - 16:21] [webDriverOperations.py:504] [INFO] Reloading main page ๐Ÿ”„
[29.04.2024 - 16:21] [webDriverOperations.py:380] [INFO] Looking for flats ๐Ÿ‘€
[29.04.2024 - 16:21] [webDriverOperations.py:387] [SUCCESS] Found 2 flat(s) in total ๐Ÿ’ก
[29.04.2024 - 16:21] [webDriverOperations.py:438] [WARNING] Ignoring flat '3-ZIMMER WOHNUNG IN MITTE WBS 140' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:21] [webDriverOperations.py:438] [WARNING] Ignoring flat '2-ZIMMER-WOHNUNG IN MITTE WBS 160/180/220' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:21] [webDriverOperations.py:61] [ERROR] Failed to switch page, last page reached โŒ
[29.04.2024 - 16:22] [webDriverOperations.py:504] [INFO] Reloading main page ๐Ÿ”„
[29.04.2024 - 16:22] [webDriverOperations.py:380] [INFO] Looking for flats ๐Ÿ‘€
[29.04.2024 - 16:22] [webDriverOperations.py:387] [SUCCESS] Found 2 flat(s) in total ๐Ÿ’ก
[29.04.2024 - 16:22] [webDriverOperations.py:438] [WARNING] Ignoring flat '3-ZIMMER WOHNUNG IN MITTE WBS 140' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:22] [webDriverOperations.py:438] [WARNING] Ignoring flat '2-ZIMMER-WOHNUNG IN MITTE WBS 160/180/220' because the size doesn't match our criteria --> Flat Size: 0.0 mยฒ | User wants it above: 40 mยฒ ๐Ÿ™ˆ
[29.04.2024 - 16:22] [webDriverOperations.py:61] [ERROR] Failed to switch page, last page reached โŒ
^CTraceback (most recent call last):
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 134, in
main()
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/main.py", line 111, in main
webDriverOperations.process_flats(
File "/Users/UsmanTatla/Desktop/wbmbot_v2-main/wbmbot_v2/helpers/webDriverOperations.py", line 500, in process_flats
time.sleep(int(refresh_internal) * 60)
KeyboardInterrupt

UsmanTatla@MacBookPro wbmbot_v2-main %

[BUG] Bot fails to detect available flats on wbm.de after recent update

Describe the bug
I've encountered an issue today where the bot has stopped identifying available flats on wbm.de, despite there being 5 flats currently listed (as per the archived page). This morning, the bot was functioning correctly; it detected a WBS flat (which was excluded based on my configuration) and attempted to apply for a non-WBS flat but was unsuccessful due to an issue. Following a fix issued by @Vel-San, I updated the Docker image, and since then, the bot has not detected any available flats.

To Reproduce

Expected behavior
The bot should consistently detect available flats on wbm.de, including after updates and fixes are applied.

Screenshots
Screen Shot 2024-02-22 at 13 23 26
Screen Shot 2024-02-22 at 12 53 52

Environment
Digest: sha256:a989a4dfe0a7817060d906620329f294f641ecaa8006970f94b60edf7b84745a

Additional context
Not a coding expert, please let me know if there's any additional information I can share to help solving this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.