3
我试图抓取一个URL(http://sportzcosmos.com/2014/03/29/european-football-leagues-weekend-predictions/)。因为我能够将数据单独获取到像段落,标题的数组中。如何从页面抓取时获取数据
但我希望他们,因为他们在网站,我使用的是simple_php_dom。
我的代码如下:
foreach($article->find('article.post div.entry-content p') as $p){
$articlecontent[] = $article->plaintext;
}
同样地,我可以得到头也:
foreach($article->find('article.post div.entry-content h2') as $h){
$articlecontent[] = $article->plaintext;
}
但我想,让他们以作为他们在网站;有什么方法可以让这些数据有序?
非常感谢!它的工作和解决了我的大部分问题... – anand