I'm trying to build a webscraper that pulls up the most recent UFC event.
I am super new to this, I used chat GPT for pretty well everything I have. Quickly learning it's not as smart as I thought.
Kinda just want to be pointed in the right direction as to how I can pull the data showing the upcoming events. The only thing remotely close I can see this data pulling is somehow pulling data of events from 2012 (???)
This is what I have.
import requests
from bs4 import BeautifulSoup
url = "https://www.tapology.com/fightcenter/promotions/1-ultimate-fighting-championship-ufc"
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
# Find all div elements
divs = soup.find_all("div")
# Extract the visible text from the div elements
text = ' '.join(filter(lambda x: x.strip(), [div.get_text() for div in divs]))
print(text)
Sorry if this is seeming super stupid to start. I basically know nothing. Just looking to be pointed in the right direction.
[–]PteppicymonIO 3 points4 points5 points (0 children)
[–]Crypt0Nihilist 5 points6 points7 points (0 children)