The variables are mostly german and the code is not commented.
pip install bs4 selenium
Make sure, that you have the right webdriver for the browser you want to use installed. I use Firefox in my example.
Run the ipynb or copy all the code to a Python file and run it there.
Be aware, that Immoscout may use a captcha. I was too lazy to automate it, so I added a timer for 15 sec to solve it by hand.