From b776386e861f5b847e45c17b83c03e94a3985be6 Mon Sep 17 00:00:00 2001 From: logan Date: Wed, 31 Jul 2024 18:18:07 -0500 Subject: [PATCH] Update README.md --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a99208c..b6a8f68 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ -StocksGame +# Stock trading bot +During my senior year of high school, my economics class had a +competition where we traded stocks on a fake online exchange. +I wrote a Python shell script which could make purchasing decisions +for me, and submit them to the website. It uses Beautiful Soup to +log in to the virtual exchange with my details, and to collect +stock information from sources like Yahoo Finance. When given a +budget, it chooses a diverse selection of shares which most closely +approaches the budget without exceeding it. + +## Challenges +Using web scraping to collect data online is difficult to do performantly +and robustly. Network errors and slow internet speeds caused the program to +run very slowly, and changes to page layouts could cause the scraper to +err. To solve these errors, a script can query several pages in parallel +and retry on network errors. Caching can also significantly speed things +up. I chose Yahoo Stocks because its page layout changes very little over +time, and I use BeautifulSoup, a very robust HTML parser and scraper to +reliably retrieve data. +