Skip to content

Instantly share code, notes, and snippets.

@hexium310
Last active November 12, 2017 16:06
Show Gist options
  • Save hexium310/86ec1abd777d6bea91dd16e894bdcf80 to your computer and use it in GitHub Desktop.
Save hexium310/86ec1abd777d6bea91dd16e894bdcf80 to your computer and use it in GitHub Desktop.
<?php
$dom = new DOMDocument();
@$dom->loadHTML(file_get_contents('http://user.keio.ac.jp/~rhotta/hellog/'));
$through = (new DOMXPath($dom))->query('//div[@id="links"]//a[@href="2009-06-20-1.html"]');
if ($through->length === 1) {
echo "今日のthrough: {$through[0]->nodeValue}\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment