嗨,我使用网络抓取网站,但它包含太多我不需要的信息。这是我的代码:
<?php
require('phpQuery.php');
$url = 'http://www.nasdaq.com/screening/companies-by-name.aspx?letter=A';
$html = file_get_contents($url);
$pq = phpQuery::newDocumentHTML($html);
echo $pq['#CompanylistResults'];
?>
结果是:
<table id="CompanylistResults">
<tbody>
<tr>
<tr>
<td>
<a target="_blank" rel="nofollow" href="http://www.1800flowers.com">1-800 FLOWERS.COM, Inc.</a>
</td>
<td>
<td style="">$100.55M</td>
<td style="display:none"></td>
<td>United States</td>
<td>1999</td>
<td style="width:105px">Other Specialty Stores</td>
我需要的是“1-800 FLOWERS.COM, Inc.” 和文本中的“$ 100.55M”,怎么做?