English 中文(简体)
Scraping from wsj.com or finance.yahoo.com
原标题:

I want to display on a wordpress page the total volume of shares traded on the NYSE stock exchange the last 2 weeks that it s been open. What is the best way to go about doing this?

最佳回答

Yahoo Finance lets you export their data. For a ticker, on the left sidebar there is a link to Historical Prices. On the bottom of that page there is a link "Download To Spreadsheet".

You could pass that to fgetcsv to parse it.

问题回答

Scraping websites for data is generally seen as unethical, depending on your intentions and the frequency of the scrape. The bandwidth isn t free, you know. Instead, you should hopefully be able to find a data feed which has been designed to be consumed by other sites, such as yours.

Not knowing very much about your domain, I wouldn t really know what to search for, but here s some guesses:

Yahoo would be your best bet as they have an unofficial api documented here:

http://www.gummy-stuff.org/Yahoo-data.htm

Tons of apps/widgets rely on this so I can t see it going away

It has in fact gone away, due to yahoo asking that it be taken down.

From first glance, this url would give you what you need: http://finance.yahoo.com/d/quotes.csv?s=^NYA&f=v





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签