-
Notifications
You must be signed in to change notification settings - Fork 0
/
fmel-homes-scraper.py
28 lines (22 loc) · 1.4 KB
/
fmel-homes-scraper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import requests
import beepy
url_15_may = "https://accommodation.fmel.ch/StarRezPortal/56e48bc61c4c34f8b425d3fe61ad580e8879b7c9037a4a5828b7ed6416c26bdeb84fb80e6efe782b7c0a21a2d2838cc2e055e2ada347919b29a526bde39ac056/71/929/Book_now-House_selection?UrlToken=89C4714B&TermID=1433&ClassificationID=1&DateStart=16%20May%202022&DateEnd=15%20May%202027"
url_1_june = "https://accommodation.fmel.ch/StarRezPortal/bec3eba564523df9ae23a9df8b7171880f4710ed8703b2d06c35af607ef60f768d17d7467028b9f7ce58e6fe652f0ed2186ff4c817ef6c825da7e448e3f15594/71/929/Book_now-House_selection?UrlToken=89C4714B&TermID=1433&ClassificationID=1&DateStart=01%20June%202022&DateEnd=31%20May%202027"
payload={}
headers = {
'Cookie': '<Add your Cookie here>'
}
response_15_may = requests.request("GET", url_15_may, headers=headers, data=payload)
response_1_june = requests.request("GET", url_1_june, headers=headers, data=payload)
print("15th May Request:", response_15_may.status_code)
print("1st June Request:", response_1_june.status_code)
if "Please check regularly for new availabilities." in response_15_may.text:
print("[FAIL]: No housing found for 15 May")
else:
print("[SUCCESS]: Housing found for 15 May")
beepy.beep(sound="ping")
if "Please check regularly for new availabilities." in response_1_june.text:
print("[FAIL]: No housing found for 1 June")
else:
print("[SUCCESS]: Housing found for 1 June")
beepy.beep(sound="ping")