Skip to content

Instantly share code, notes, and snippets.

@reefwing
Created March 25, 2023 08:05
Show Gist options
  • Save reefwing/88f33d26977d8d9504522253fcab43dd to your computer and use it in GitHub Desktop.
Save reefwing/88f33d26977d8d9504522253fcab43dd to your computer and use it in GitHub Desktop.
NON WORKING share scaping script
# Import necessary modules
import pandas as pd
import requests
# Assign ticker to a variable
ticker = "STW.AX"
# Construct the URL for the API
url = f"https://query1.finance.yahoo.com/v7/finance/quote?symbols={ticker}"
# Make the request
response = requests.get(url)
# Convert to json
data = response.json()
# Extract the data
results = data['quoteResponse']['result']
# Create a dataframe
df = pd.DataFrame(results)
# Print the dataframe
print(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment