curl 抓取页面html,如何使用curl函数从存储为字符串的HTML页面中提取值

我使用php/curl将HTML获取到一个字符串中,然后需要提取以下数据,然后从中投影出一个图表。

我想要的数据如下:

/p>

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org" />

Income

Operating income22,922.0021,507.3017,492.6013,683.9010,227.12

Expenses

Material consumed4,029.403,442.602,952.301,889.001,367.67
Manufacturing expenses 2,213.201,841.80299.80120.501,020.70
Personnel expenses9,062.809,249.807,409.105,768.204,279.03
Selling expenses378.10308.40532.10-171.05
Adminstrative expenses1,737.001,906.002,583.702,651.70904.78
Expenses capitalised-----
Cost of sales17,420.5016,748.6013,777.0010,429.407,743.22
Operating profit5,501.504,758.703,715.603,254.502,483.90
Other recurring income434.20468.20326.90288.70113.59
Adjusted PBDIT5,935.705,226.904,042.503,543.202,597.49
Financial expenses108.40196.80116.807.203.13
Depreciation 579.60533.60456.00359.80292.26
Other write offs-----
Adjusted PBT5,247.704,496.503,469.703,176.202,302.10
Tax charges 790.80574.10406.40334.10286.10
Adjusted PAT4,456.903,922.403,063.302,842.102,016.00
Non recurring items441.10-948.60--38.33
Other non cash adjustments-----33.85
Reported net profit4,898.002,973.803,063.302,842.102,020.48
Earnigs before appropriation4,898.002,973.803,063.302,842.102,020.48
Equity dividend880.90586.00876.50873.70712.88
Preference dividend-----
Dividend tax128.3099.60148.90126.8099.98
Retained earnings3,888.802,288.202,037.901,841.601,207.62

我想提取每一个值,比如制造数据和该行中提到的所有年份的值。我该怎么办?

我发现了一些

preg_match('#

(.*) price#', $content, $match);

但这不符合我想要的价值观。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值