看板Programming
标 题Re: [问题] 要做个自动抓基金净值功能
发信站SayYA 资讯站 (Sun Sep 26 20:05:16 2010)
转信站ptt!news.ntu!ctu-gate!ctu-peer!news.nctu!News.Math.NCTU!SayYa
※ 引述《[email protected] (我在O2的年纪逐渐升高了)》之铭言:
> 如题
> http://fund.cnyes.com/Detail/historicalNav/B08,020.html
> 例如上面连结
> 想打开程式後就自动净值更新,然後存在一个txt档
> 我才不用每次都手动更新
> 然後我再用程式自己分析txt里面的净值,得到我想要的计算
> 更新的功能该如何实现呢?
wget -O - -q
http://fund.cnyes.com/Detail/historicalNav/B08,020.html \
| grep '个别基金:start' \
| sed -e 's|.*<td class="pe r">\([0-9]\+\.[0-9]\{2\}\)</td>.*|\1|g' > a.txt
产生的 a.txt 内容类似这样:
1.77
--
※ Origin: SayYA 资讯站 <bbs.sayya.org>
◆ From: c-76-111-34-186.hsd1.ga.comcast.net
1F:推 theater:用perl写的吗,好简单有力 125.231.2.53 09/26 21:28
2F:推 horngsh:那是unix shell script..112.104.191.119 09/26 21:29
3F:推 theater:我要在windows上跑的 125.231.2.53 09/27 11:16
4F:推 LPH66:是说 gnu for windows 这三个公用程式都有.. 140.112.30.133 09/27 13:17
5F:→ LPH66:我自己就用的很高兴 XD 140.112.30.133 09/27 13:17
6F:推 loveme00835:楼上正解~140.121.197.115 09/27 15:15
7F:推 theater:可以简单引导要装哪个程式,怎麽跑吗 125.231.2.223 10/03 12:46
8F:推 theater:三个公用程式是指 wget,grep, sed ? 125.231.2.223 10/03 12:53