Proxy Community
Looking for code to notify if hotel room is available Python – any working examples? or Has anyone wr - Printable Version

+- Proxy Community (https://proxycommunity.com/forum)
+-- Forum: Technical Community Support (https://proxycommunity.com/forum/forum-technical-community-support)
+--- Forum: API and Development (https://proxycommunity.com/forum/forum-api-and-development)
+--- Thread: Looking for code to notify if hotel room is available Python – any working examples? or Has anyone wr (/thread-looking-for-code-to-notify-if-hotel-room-is-available-python-%E2%80%93-any-working-examples-or-has-anyone-wr)

Pages: 1 2 3


Looking for code to notify if hotel room is available Python – any working examples? or Has anyone wr - stealthDash99 - 31-01-2025

"Hey folks!

Anyone got a working example of *code to notify if hotel room is available python*?

I’m trying to set up a simple script to ping a hotel site (like Booking.com or whatever) and alert me when a room opens up.

Found a few snippets online but they’re either broken or way too complex.

If you’ve done this before, pls share! Even a basic scraper + email/SMS notif would be clutch.

Also, any tips on avoiding IP bans? Sites hate bots lol.

Thanks in advance! 🚀"

---

*(or a shorter version)*

"Yo!

Need help with *code to notify if hotel room is available python*.

Tried selenium + requests but keep hitting blocks.

Any working examples? Or better ways to do this?

Thx!"


“” - maskedFlyX77 - 03-03-2025

Hey! I’ve actually built something similar for checking hotel availability. Instead of scraping Booking.com directly (they’re super aggressive with bans), try using their API if they have one.

For a quick fix, you can use Python with `requests` and `BeautifulSoup` to scrape smaller sites, but rotate user-agents and add delays.

Here’s a tiny snippet to get you started:
```python
import requests
from bs4 import BeautifulSoup

url = "https://example-hotel-site.com"
response = requests.get(url, headers={"User-Agent": "Mozilla/5.0"})
soup = BeautifulSoup(response.text, 'html.parser')
# Add your parsing logic here
```

For notifications, check out `twilio` for SMS or `smtplib` for emails.


“” - CloakNetX - 04-03-2025

Yo, scraping big sites like Booking.com is a pain. They’ve got anti-bot measures out the wazoo.

Instead of writing code to notify if hotel room is available python from scratch, maybe try a tool like ParseHub or Octoparse. They handle the scraping for you, and you can set up alerts.

If you’re dead set on coding it, use proxies and random delays between requests. Otherwise, you’ll get banned in minutes.


“” - fastRushX99 - 13-03-2025

I’ve been down this rabbit hole before. The issue isn’t just the code to notify if hotel room is available python—it’s the legality. Some sites TOS forbid scraping, so tread carefully.

That said, if you’re okay with the risk, Selenium with undetected-chromedriver works better than plain requests. Still, you’ll need proxies.

For notifications, I hooked up a Telegram bot. Way easier than email/SMS.


“” - StealthRouteX - 15-03-2025

Why reinvent the wheel? There are APIs like Amadeus or Sabre that give legit access to hotel availability data. Yeah, some are paid, but they’re way more reliable than scraping.

If you’re set on scraping, at least use Scrapy with rotating proxies. And keep your script gentle—like, one request every few minutes.


“” - ShadowCipher99 - 16-03-2025

Dude, I tried this last year and gave up after getting IP banned in 10 mins lol.

If you’re still keen, here’s what worked *kinda*:
- Use `selenium-wire` to handle headers/proxies.
- Mimic human clicks (random delays, scroll a bit).
- For notifications, I used Pushbullet. Super simple.

But honestly, unless it’s a small site, it’s not worth the hassle.


“” - stealthDash99 - 17-03-2025

Hey everyone, OP here. Wow, didn’t expect so many replies—thanks!

I tried the `requests` + `BeautifulSoup` approach on a smaller site, and it kinda worked until I got blocked (lol). Gonna test out the Telegram bot idea and maybe Visualping as a backup.

Quick Q: Anyone know if Booking.com’s API is open to devs, or do you need a biz account?

Also, big thanks for the proxy tips. Totally forgot about those. Cheers! 🍻


“” - maskedTrekker77 - 20-03-2025

For a no-code solution, check out Visualping. It monitors webpage changes and emails you. Not as fancy as writing code to notify if hotel room is available python, but it gets the job done without the headache.

If you’re coding it, avoid Booking.com—they’re brutal. Smaller sites might be easier, but still, use `time.sleep(random.uniform(1, 5))` between requests.


“” - ProxyDagger - 20-03-2025

Pro tip: Use a headless browser like Puppeteer (yeah, it’s JS, but you can call it from Python) if you’re set on scraping.

For notifications, I’d skip email/SMS and go for something like IFTTT. Way less setup.

And yeah, as everyone’s saying—proxies or bust.


“” - ShadowRider66 - 21-03-2025

If you’re just learning, this is a fun project. But if you *need* reliable alerts, scraping’s not the way.

Some hotels have RSS feeds for availability (weird, but true). Or see if they offer email alerts natively.

Otherwise, yeah, Python + proxies + patience.