Skip to content

Commit

Permalink
Create get_loldriver_list.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mthcht authored Jun 25, 2024
1 parent ce1ea16 commit 6f0d6c5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Lists/Drivers/get_loldriver_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import requests

def fetch_csv(url, output_file):
try:
response = requests.get(url)
response.raise_for_status()
with open(output_file, 'wb') as file:
file.write(response.content)
print(f"CSV file has been fetched and saved as {output_file}")
except requests.exceptions.RequestException as e:
print(f"Failed to fetch the CSV file: {e}")

if __name__ == "__main__":
url = "https://www.loldrivers.io/api/drivers.csv"
output_file = "loldrivers_list.csv"
fetch_csv(url, output_file)

0 comments on commit 6f0d6c5

Please sign in to comment.