name=""
Web サイトのすべての属性を抽出したいのですが、
html の例
<div class="link_row">
<a href="" class="listing_container" name="7777">link</a>
</div>
次のコードがあります。
<?php
$html = new DOMDocument();
@$html->loadHtmlFile('http://www.onedomain.com/plus?ca=11_c&o=1');
$xpath = new DOMXPath( $html );
$nodelist = $xpath->query( "//div[@class='link_row']/a[@class='listing_container']/@name" );
foreach ($nodelist as $n){
echo $n->nodeValue."\n<br>";
}
?>
結果は次のとおりです。
7777
このコードは正常に機能していますが、1 つのポケットベル番号に限定する必要はありません。
http://www.onedomain.com/plus?ca=11_c&o=1
ページャー属性は"o=1"
で終了したら
、定義済みの変数が等しいo=1
に続いてくださいo=2
$last=556
http://www.onedomain.com/plus?ca=11_c&o=556
私たちを手伝ってくれますか?それを行う最良の方法は何ですか?
ありがとう