Closed StephanAkkerman closed 1 week ago
Maybe scrape sector information from: https://www.tradingview.com/markets/stocks-usa/sectorandindustry-sector/consumer-services/
https://trendlyne.com/equity/sector-industry-analysis/sector/day/ also has interesting sector info
https://www.barchart.com/stocks/market-performance seems to have the data necessary for making the plot
Can scrape from the raw HTML, probably easy to do
import pandas as pd
import requests
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
r = requests.get("https://www.barchart.com/stocks/market-performance", headers=headers)
df = pd.read_html(r.text)
print(df)
From this tweet https://x.com/bespokeinvest/status/1747378516784447520?s=46&t=kVjHUwwWD5s9buPqlc0doQ