Bleed.
Flag: | United Kingdom |
Registered: | May 30, 2021 |
Last post: | September 30, 2024 at 11:26 AM |
Posts: | 118 |
accusing a community is only wrong if the accusations themselves are wrong
honestly i dont know enough about it in practice to know if it'd work well, but that makes sense
i think hamming distance relies on the object and target being the same size/length though, so might not work well
should have it set up for users by september, depends how often i get to work on it
i unfortunately got beaten to the idea by another guy (cant remember his sites name), but im mainly just doing this for a personal project
yeah thats a good point, thanks. I'll set the whole file up as a function to call for different parts of the site I think. Its very bare bones atm and it only works for individual leagues during splits (it gets really complicated when teams are playing different amounts of matches).
trying to make a VLR fantasy league site, so converting the stats page - with relevant parameters - into csv file/mysql database. pretty low level but ive got it working alright now. using it for a stats page on my site, and to be able to have the data for when players want to have their own teams. makes it a lot more efficient than sending GET requests for everything client side.
def scrapeStats(url):
getResponse = requests.get(url)
#verifying successful request response
if getResponse.statuscode == 200:
#parse HTML content
doc = BeautifulSoup(getResponse.content, "html.parser")
#saving only table data
table = doc.find(class='wf-card mod-table mod-dark')
headers = []
rows = []
#extract and fill the header and row arrays with table data
for th in table.find_all('th'):
headers.append(th.text.strip())
for tr in table.find_all('tr')[1:]:
row = []
for td in tr.find_all('td'):
row.append(td.text.strip())
rows.append(row)
return headers, rows
else:
#in case of unsuccessful request response
print("Request Error")
return None, None
def clean_data(headers, rows):
#appending new team column
for row in rows:
player_name = row[0]
team_name = player_name.split()[-1]
row.append(team_name)
#deleting redundant agents column
agents_index = headers.index('Agents')
for row in rows:
del row[agents_index]
del headers[agents_index]
def save_to_csv(headers, rows, fileName):
with open(fileName, 'w', newline='') as csvFile:
writer = csv.writer(csvFile)
#write headers and rows
#create team header
writer.writerow(headers + ['Team'])
for row in rows:
writer.writerow(row)
print(f"Data has been saved to {fileName}")
def main():
#change this depending on the vlr stats page that you want it to scrape from
url = "https://www.vlr.gg/event/stats/1921/champions-tour-2024-masters-madrid?exclude=&min_rounds=0&agent=all"
#created CSV file name
fileName = 'vlr_stats.csv'
#scraping data
headers, rows = scrapeStats(url)
#check data is retrieved successfully
if headers and rows:
#clean data
clean_data(headers, rows)
#save data to CSV file
save_to_csv(headers, rows, fileName)
if name == "main":
main()
yeah im working on a webscraper from VLR atm but for stats only, messages sounds horrific in comparison. Don't have a good enough understanding for evaluating efficiency. Although I think there are fuzzy matching packages for the sort of stuff you're looking into.
tbh i think that you'll be able to find an open-source program to do this for you, but if you wanted to do it yourself i think you could try to tokenise keywords - so it evaluates a specific order of tokens as the target phrase. idk how you'd actually code this though
they had a a retake setup the whole game so if john gets no contact elbow then its that setup lmao
jeremy clarkson is a better farmer
feel bad for the casters like tf they supposed to do there
more that zekken struggles on controller ig
physically convulsed @riot BAN HIM
@mods doing sum webscraping of the stats page and I noticed that s0m's team is apparently 'Team' right now. Could we get a fix pls? :)
not an NRG problem Crashies is fine
wym coping they are bro LMAO
bannable imo
just changed my pickems to VIT winning because of this
on map 3???? neon for kayo would be a massive troll
C9 yay lover I have decided that you have fallen off
Thank you.
SigmaMale do what you know is right.
personally i disagree with this
take it down