Open ucym opened 9 years ago
ファイルからHTMLを読み込んで"ul#nav"を検索し、その中の"li"を検索、そのli要素の内部のテキストをechoする。
<?php // PHP Simple HTML DOM Parser $html = file_get_html('http://www.google.com/'); foreach ($html->find('ul#nav')->find('li') as $element) { echo $element->plaintext; }
<?php // phpQuery // TODO
検討中のライブラリ
TODO
サンプル
ファイルからHTMLを読み込んで"ul#nav"を検索し、その中の"li"を検索、そのli要素の内部のテキストをechoする。