Stock Data Crawling
Stock and chart data have the dynamic characteristic of changing constantly over time.
Tracking these real-time changes is crucial for data extraction.
Until now, we have learned methods to extract static data that doesn't change rapidly, using libraries like requests and BeautifulSoup.
However, to extract dynamic data controlled by JavaScript, you'll need to use a library called Selenium.
In the practice section, you can check out the code that uses Selenium to crawl the U.S. stock indexes from Yahoo Finance.
Note: For more detailed information about Selenium, you can check out
Essential Knowledge for Automating Work, Chapter 3Collecting Data through Web Crawling, in the 3rd course of Automation with Python and AI.
Practice
Press the Run Code button on the right side of the screen to check the crawling results or modify the code!
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help
Code Editor
Execution Result