Scrape Yahoo Finance
How to Scrape most active stocks in Yahoo Finance without any input.
The modules are well documented, it shows you how to collect the data, I want to improve it a little bit so that the data will be saved as CSV and you can use it for doing your research as a machine learning engineer. Here is the code that I created.
To make a bot which scrape most active stocks in Yahoo Finance without any input, follow these steps:-
1. To create a new bot, click DK extension and type “yahoo_most_active” and then click “ + New Api”.
2. Now open https://www.studioproper.com/collections/shop-all-products in the browser before training the bot, and click “Record” to train the bot.
3. Then Reload the page to add the URL to the event. https://finance.yahoo.com/most-active/,
4. Add static wait to take time for browser to load the page Datakund=>Wait=>Static=>3, to scrape the product name.
5.Then add scroll to end to add event to get all the stocks after scroll Datakund=>More=>Scroll to end, to scrape the stocks name.
6. Now right click on the website screen, then click Datakund=>Start Repeat, to add loop for scraping similar items.
7. Now click the keyboard icon to add the outputs such as symbol
p_e , then click on save and back to recording
8.Then right click on first stock and then Datakund=>Scrape=>Text=>symbol, to scrape the stock symbol.
Similarly we can scrape stock - name, price, chane, volume, market_cap, p_e.
9. Now stop the training(by back), and click “run”.
10. As there is no input needed just click “Run Google sheet”
11. Now the inputs are scrape automatically, status can be seen in notifications
12.Results can be seen in extension as well as update in google sheet, in output sheet of spreadsheet.