Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 15, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 15, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 15, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 15, 2025

      Intel’s latest Arc graphics driver is ready for DOOM: The Dark Ages, launching for Premium Edition owners on PC today

      May 15, 2025

      NVIDIA’s drivers are causing big problems for DOOM: The Dark Ages, but some fixes are available

      May 15, 2025

      Capcom breaks all-time profit records with 10% income growth after Monster Hunter Wilds sold over 10 million copies in a month

      May 15, 2025

      Microsoft plans to lay off 3% of its workforce, reportedly targeting management cuts as it changes to fit a “dynamic marketplace”

      May 15, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      A cross-platform Markdown note-taking application

      May 15, 2025
      Recent

      A cross-platform Markdown note-taking application

      May 15, 2025

      AI Assistant Demo & Tips for Enterprise Projects

      May 15, 2025

      Celebrating Global Accessibility Awareness Day (GAAD)

      May 15, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Intel’s latest Arc graphics driver is ready for DOOM: The Dark Ages, launching for Premium Edition owners on PC today

      May 15, 2025
      Recent

      Intel’s latest Arc graphics driver is ready for DOOM: The Dark Ages, launching for Premium Edition owners on PC today

      May 15, 2025

      NVIDIA’s drivers are causing big problems for DOOM: The Dark Ages, but some fixes are available

      May 15, 2025

      Capcom breaks all-time profit records with 10% income growth after Monster Hunter Wilds sold over 10 million copies in a month

      May 15, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»I am trying to make a python bot to alarm me when an appointment in the goverments office is available but 403 Error

    I am trying to make a python bot to alarm me when an appointment in the goverments office is available but 403 Error

    August 9, 2024

    I just want it to past the first page by selecting “1” from the dropdown menu and clicking on “Weiter” but I couldn’t even get it to find the menu so I tried to make it send the data directly to the server and jump to the next page where the appointments should be then showned. But I am getting the message “Access denied to this page (403)” from Microsoft Edge… What should I do? I have actually no idea of what I am doing… I’ve been using ChatGPT to help me with the code. Thanks!

    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.edge.service import Service
    from selenium.webdriver.edge.options import Options
    import time

    Path to the Microsoft Edge WebDriver

    webdriver_path = “C:UsersthejaDesktopBotmsedgedriver.exe”

    URL of the website

    url = “https://stadt.muenchen.de/terminvereinbarung_/terminvereinbarung_abh.html?cts=1000113”

    Set up the Edge WebDriver with a custom User-Agent

    options = Options()
    options.headless = False # Run in normal mode to see the browser
    options.add_argument(“user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36”)
    service = Service(webdriver_path)
    driver = webdriver.Edge(service=service, options=options)

    try:
    # Open the website
    driver.get(url)

    # Wait for the page to load completely
    wait = WebDriverWait(driver, 20) # Increased wait time
    wait.until(EC.presence_of_element_located((By.TAG_NAME, “body”)))

    # Execute JavaScript to submit the form
    script = “””
    var form = document.createElement(‘form’);
    form.method = ‘POST’;
    form.action = ‘https://stadt.muenchen.de/terminvereinbarung_/terminvereinbarung_abh.html?cts=1000113’;

    var token = document.createElement(‘input’);
    token.type = ‘hidden’;
    token.name = ‘FRM_CASETYPES_token’;
    token.value = ‘397017935ccff9a3e347532ef2898855’;
    form.appendChild(token);

    var step = document.createElement(‘input’);
    step.type = ‘hidden’;
    step.name = ‘step’;
    step.value = ‘WEB_APPOINT_SEARCH_BY_CASETYPES’;
    form.appendChild(step);

    var caseType = document.createElement(‘input’);
    caseType.type = ‘hidden’;
    caseType.name = ‘CASETYPES[Notfalltermin UA 35]’;
    caseType.value = ‘1’;
    form.appendChild(caseType);

    document.body.appendChild(form);
    form.submit();
    “””
    driver.execute_script(script)

    # Wait for the next page to load
    wait.until(EC.presence_of_element_located((By.TAG_NAME, “body”)))

    # Keep the browser open for further actions
    print(“Browser will remain open. Press Ctrl+C to exit.”)
    while True:
    time.sleep(1)

    except Exception as e:
    print(f”An error occurred: {e}”)
    driver.save_screenshot(“error_screenshot.png”) # Save a screenshot of the error

    Do not close the browser, keep it open for further actions

    Source: Read More

    Hostinger
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDesigner Spotlight: Vladimir Biondić
    Next Article Is it possible to automatically aggregate / collect test results from different projects using Serenity BDD?

    Related Posts

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-4732 – TOTOLINK A3002R/A3002RU HTTP POST Request Handler Buffer Overflow

    May 16, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-47809 – Wibu CodeMeter Privilege Escalation Vulnerability

    May 16, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Researchers Identify Over 20 Supply Chain Vulnerabilities in MLOps Platforms

    Development

    Linkero

    Web Development
    A Steam Deck prototype was sold on Ebay for $2000

    A Steam Deck prototype was sold on Ebay for $2000

    News & Updates

    How to Use FakeLogger to Make Testing Easier In .Net

    Development

    Highlights

    Development

    Snowflake AI Research Team Unveils Arctic: An Open-Source Enterprise-Grade Large Language Model (LLM) with a Staggering 480B Parameters

    April 25, 2024

    Snowflake AI Research has launched the Arctic, a cutting-edge open-source large language model (LLM) specifically…

    5 Amazon Alexa privacy settings you should change right away

    August 5, 2024

    Intelligenza Artificiale: Strumento di Supporto e Non di Sostituzione

    March 22, 2025

    Chrome Incognito getting faster at cost of Privacy

    February 11, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.