【发布时间】:2014-03-10 23:51:18
【问题描述】:
我正在尝试读取带有 file_get_contents() 的 URL。我只需要从页面中获取$invoice。
$invoice 出现在类似于以下示例的句子中作为数字 789621 :
paid <strong>789621</strong>
我该怎么做?
【问题讨论】:
标签: php web-scraping file-get-contents
我正在尝试读取带有 file_get_contents() 的 URL。我只需要从页面中获取$invoice。
$invoice 出现在类似于以下示例的句子中作为数字 789621 :
paid <strong>789621</strong>
我该怎么做?
【问题讨论】:
标签: php web-scraping file-get-contents
您需要simple_html_dom 从页面抓取发票。 然后使用
$ret = $html->find('div[id]');
检索包含发票的 div。
$content=$ret->innertext;
给出该 div 的内容。休息很简单。只需将 $content 与 ' '(space) 分开并获取您的 $invoice
【讨论】: