StockScraper | retrieves Yahoo Finance stock information using YQL | Business library
kandi X-RAY | StockScraper Summary
kandi X-RAY | StockScraper Summary
stockretriever.py A self-contained script that retrieves stock information from Yahoo! Finance using YQL. Usage described @ Python 3 Version: A Python3 version of this code can be found at:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get historical data for a given symbol .
- Retrieves the current status of the given symbols .
- Execute a YQL query .
- Validate the response .
- Return the news feed for a given symbol .
- Get industry index .
- Check if the response contains a valid JSON response .
- Format a list of symbols .
StockScraper Key Features
StockScraper Examples and Code Snippets
throw new Error('test'); // This is the original code
require('source-map-support').install();
throw new Error('test'); // This is the compiled code
// The next line defines the sourceMapping.
//# sourceMappingURL=compiled.js.map
{
"version":
Community Discussions
Trending Discussions on StockScraper
QUESTION
I have a program I am writing that takes user input to connect to a site, download it's html into a text, and retrieve data from a table twice a day. I understand the code will not be one size fits all for any page (I will likely "hardwire" the url into the code once I get it working). My issue presently is that my jsoup parser isn't properly reading in the tabular data. I'm not sure if my element selectors are too generic? The table looks like it is in standard table/tr/td format, but my rows array populates with size 0. If someone could help me debug my parser and possibly provide some suggestions on where to look for making it grab data silently twice a day, I'd really appreciate it! No runtime/compile errors, just need to correct output.
Source site: https://www.cnbc.com/us-markets/ Source code for table (snipet) :
...ANSWER
Answered 2020-Apr-06 at 23:17The problem here is that this site is a dynamic page that is loading content after the browser initially downloads the page. Jsoup is not going to be adequate to scrape pages like this. A couple options you have:
1) Use a tool that simulates a browser and makes all the necessary api calls. A couple options are Selenium WebDriver or HTMLUnit.
2) Figure out the api calls you are interested in on this site, and just call those api's directly to get a JSON document you can parse. You can see api details by opening developer tools in your browser, then look at the Network tab. For this site an example would be the following, which includes the stock quote for DJI:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install StockScraper
You can use StockScraper like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page