i am using this check this out on
Uk49s Lunchtime Results
import requests
from bs4 import BeautifulSoup
url = "https://lunchtimeresult.com/"
headers = {
"User-Agent": "Mozilla/5.0" # Helps avoid blocks from the server
}
response = requests.get(url, headers=headers)
# Check if request was successful
if response.status_code != 200:
print(f"Failed to retrieve page, status code: {response.status_code}")
exit()
soup = BeautifulSoup(response.text, 'lxml')
# Inspect the correct container; this part might change depending on site's structure
lunchtime_section = soup.find("div", class_="results") # Update if needed based on inspection
if not lunchtime_section:
print("Could not find the Lunchtime results section.")
exit()
# Check for correct class used for balls
numbers = lunchtime_section.find_all("span", class_="ball")
if not numbers:
print("No result numbers found.")
exit()
# Print the result numbers
for num in numbers:
print(num.get_text(strip=True))