再会。
行 DOM HTML:
<div class="raw_data">
<span data-bind-domain="raw_registrar_lookup">
Domain Name: ABATE.COM
<br>
Registrar URL: http://www.godaddy.com
<br>
Registrant Name: Jim Elgin
<br>
Registrant Organization: ABATE of Ohio, Inc.
<br>
Name Server: NS43.DOMAINCONTROL.COM
<br>
Name Server: NS44.DOMAINCONTROL.COM
<br>
<br>
For complete domain details go to:
<br>
http://who.godaddy.com/whoischeck.aspx?domain=ABATE.COM<br>
<br>
Information Updated: Wed, 4 Sep 2013 23:43:18 UTC<br>
</span>
</div>
要获取类名 *raw_data* 的 html div,我使用代码:
$file = file_get_contents('http://who.is/whois/abate.com');
libxml_use_internal_errors(true);
$dom = new DOMDocument();
$dom->loadHTML($file);
$xpath = new DOMXPath($dom);
$res = $xpath->evaluate('//div[contains(concat(' ',@class,' '),"raw_data")]');
但不工作...
1)请告诉我哪里出错了?
2)我只能在 span 中获取 html<span data-bind-domain="raw_registrar_lookup">
吗?