cybersecurity.forum

    Cybersecurity Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Flipper Out of Stock? - This script will check the site every hour

    Python
    1
    1
    2
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TheBeef
      TheBeef last edited by

      import requests
      from bs4 import BeautifulSoup
      import time
      from fake_useragent import UserAgent
      
      ua = UserAgent()
      
      while True:
          try:
              #create headers
              headers = {'User-Agent': ua.random}
              time.sleep(0)
              # Download the website's HTML
              response = requests.get("https://shop.flipperzero.one/", headers=headers)
              response.raise_for_status()
              html = response.text
      
              # Use BeautifulSoup to parse the HTML
              soup = BeautifulSoup(html, 'html.parser')
      
              # Check for the presence of "SOLD OUT"
              if soup.find("span", text="Sold out"):
                  print("SOLD OUT still appears on the website.")
              else:
                  print("SOLD OUT no longer appears on the website!")
          except requests.exceptions.RequestException as e:
              # handle error
              print(f'Error: {e}')
          except Exception as e:
              # handle other errors
              print(f'Error: {e}')
          finally:
              # Sleep for 1 hour
              time.sleep(60*60)
      
      

      Variety.Marketing

      Cybersecurity.Enterprises

      Webhost.WTF

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by Cybersecurity Enterprises | Website by WTF