Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
362 views
in Technique[技术] by (71.8m points)

python - Kaggle - Complete Leaderboard Download

I am trying to download the Kaggle leaderboard table available under an individual Kaggle competition. I have used the Kaggle API and also downloaded it via the 'Raw Data' output but the table data is incomplete.

The downloaded table specifically does not contain information on '# of Entries' and 'Member Details (if available for a competition)'.

I have tried scraping the table (based on code available here) as well but the code is unable to identify any table on the website:

from bs4 import BeautifulSoup
import requests
import pandas as pd
import re
# Site URL
url="https://www.kaggle.com/c/jane-street-market-prediction/leaderboard"

# Make a GET request to fetch the raw HTML content
html_content = requests.get(url).text

# Parse HTML code for the entire site
soup = BeautifulSoup(html_content, "lxml")
#print(soup.prettify()) # print the parsed data of html

# The following line will generate a list of HTML content for each table
leaderboard = soup.find_all('table', attrs={"class": "competition-leaderboard__table"})
print("Number of tables on site: ",len(leaderboard))

Would be great if someone could help out on this. Thanks in advance!

question from:https://stackoverflow.com/questions/65920780/kaggle-complete-leaderboard-download

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...