Skip to content

Instantly share code, notes, and snippets.

@komeiji-satori
Last active March 7, 2018 11:14
Show Gist options
  • Save komeiji-satori/656848370f5fe50703962cd96283e5c7 to your computer and use it in GitHub Desktop.
Save komeiji-satori/656848370f5fe50703962cd96283e5c7 to your computer and use it in GitHub Desktop.
QueryListDemo
{
"require": {
"jaeger/querylist": "^4.0",
"rmccue/requests": "^1.7",
}
}
<?php
include 'vendor/autoload.php';
$ql = QL\QueryList::getInstance();
$ql->bind('cURL', function ($url) {
Requests::register_autoloader();
$headers = [
];
$response = Requests::get($url, $headers);
$this->setHtml($response->body);
return $this;
});
$dom = $ql->cURL('https://www.sgroom.com/web/post/2620318');
$desc = $dom->find('body > div.container.main-shadow > div:nth-child(4)')->find('p')->html();
print_r($desc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment