正如我在前面的问题中所建议的,我使用PHP Simple HTML DOM Parser 作为搜索HTML文档并从特定元素(在本例中为textarea)抓取内容的一种方法。我想知道是否有人曾经使用过,并能够给我任何建议(或推荐其他解决方案)。该代码我用这样的容貌:PHP DOMParser帮助
include "../simple_html_dom.php";
$html = file_get_html('http://example.com');
$textarea = $html->find('textarea[id=body]');
$contents = $textarea->outertext;
echo $contents;
我的问题是,脚本运行的代码,并从元素检索任何数据(这看起来是这样的:
<textarea id="body" name="body" rows="12" cols="75" tabindex="3">
At 2/21/10 10:15 PM, You wrote
: Hello world,
: how are you today?
</textarea>
对不起如果其他人有任何建议,将不胜感激。非常感谢你提前