View Full Version : Get data from a website
11-14-2011, 04:24 PM
I need to grab the data from a website and display it on my .PHP page...........
For instance, get the STOCK MARKET details from a STOCK MARKET WEBSITE and i want to display
those STOCK DETAILS in my .PHP page.....
11-14-2011, 05:15 PM
Give us the URL to that stock website so we can see how they format their HTML.
If you have to log-in, that's going to be a problem
11-14-2011, 05:20 PM
If there is no API, you can try simple screen-scraping of the entire target page (I would recommend caching and using a database for this), again via either file_get_contents() or the cURL library. Then you will need a good way to match the right data pattern from their source code in order to display the desired data (if they use element IDs then this becomes a bit easier, but it's never too much fun to do this). Just make sure that this isn't against their terms of service or you might have some trouble down the road.
I would use a combination of Curl and Simple html dom parser:
Use curl to get to post/get etc and Simple html dom parser to parse through the results.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.