私はScraperWikiを試していましたが、昨日、li
DOM内のすべてのリストを取得できました。ただし、現在は1回の反復しか実行していません。
これは私のコードです
$html = 'www.blah...'
$dom = new simple_html_dom();
$dom->load($html);
print_r('Starting parse');
$events = $dom->find("ul.listing li");
print_r('Found '.count($events).' events'); // shows there are 26 nodes
foreach($events as $data){
// perform some processing then print to the console
私は実際にはPHPの人ではないので、明らかな何かが欠けている可能性があります。完全なソースはhttps://scraperwiki.com/scrapers/days_of_the_year/にあります