0
我想使用curl獲取信息。獲取信息形式phpdom
大概我得到了所有信息,但我需要單獨獲取信息。
例如,我正在使用curl獲取td文本。
這裏是TD內容
我需要提取文本 「我的信息」,MyInfo的HREF鏈接和最後的頁碼。
我該怎麼做?
這裏是我的代碼,我使用的捲曲
$nodes = $finder->evaluate('//td[contains(text(), "") and starts-with(@id, "td_threadtitle_") ]');
foreach ($nodes as $node)
{
$innerHTML = trim($tmp_dom->saveHTML());
$fh = fopen("test.html", 'w'); // we create the file, notice the 'w'. This is to be able to write to the file once.
//writing response in newly created file
fwrite($fh, $node->c14n()); // here we write the data to the file.
fclose($fh);
}
我解決了這個問題,你可以請檢查我的回答是好還是不好?但它的工作正常。 – neo