これは私がphpでそれを行う方法です=)
<?php
$oldSetting = libxml_use_internal_errors( true );
libxml_clear_errors();
$html = new DOMDocument();
$html->loadHtmlFile( 'http://www.catererglobal.com/rzwritingajobad.html' );
$xpath = new DOMXPath( $html );
$links = $xpath->query( '//a' );
foreach ( $links as $link ) {
$cur = $link->getAttribute( 'href' );
if (preg_match('/(promote|job)/', $cur)) { echo "$cur\n"; }
}
libxml_clear_errors();
libxml_use_internal_errors( $oldSetting );
?>
出力は次のとおりです。
http://www.catererglobal.com/recruiters/rz-job-advertising/10298792/post-a-job/
/recruiters/rz-job-advertising
/recruiters/rz-promote-your-brand
/moreterms/job-location
http://www.madgex.com/job-boards/
Xpathは私たちの親友です;)