You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import requests
import os
Telegram settings - USE ENVIRONMENT VARIABLES IN PRODUCTION!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Install requirements
!apt-get update
!apt-get install -y chromium-chromium-driver
!pip install selenium requests
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import requests
import os
Telegram settings - USE ENVIRONMENT VARIABLES IN PRODUCTION!
TELEGRAM_TOKEN = os.getenv('TELEGRAM_TOKEN', '7617189872:AAHQV2-gzjYsH-sMAhZqwzDsXT4Jr-THlpE')
CHAT_ID = os.getenv('5582659561')
def send_telegram_message(text):
url = f"https://api.telegram.org/bot{TELEGRAM_TOKEN}/sendMessage"
data = {"chat_id": CHAT_ID, "text": text, "parse_mode": "Markdown"}
try:
response = requests.post(url, data=data)
return response.status_code == 200
except Exception as e:
print(f"[ERROR] Telegram send failed: {str(e)}")
return False
def main():
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
if name == "main":
main()
Beta Was this translation helpful? Give feedback.
All reactions