使用新的simple_html_dom获取链接和文本

Using new simple_html_dom

How I can get

  1. The Link

  2. The text(name)

    div class="stackoverflow" href="http://stackoverflow.com">Stackoverflow div

I think you use inner and outertext but I'm new to all of this so I thought I'll ask the experts.

Thanks

EDIT: I removed the anchor's as they where been parsed and turned into an actually link.

From the simple_html_dom documentation: http://simplehtmldom.sourceforge.net/manual.htm

$html = str_get_html('<div class="stackoverflow" href="http://www.stackoverflow.com">Stackoverflow Div</div>');

$e = $html->find("div.stackoverflow");

$link = $e->href;

$name = $e->innertext;

Obviously you can change the html input etc.