Last active
March 7, 2018 11:14
-
-
Save komeiji-satori/656848370f5fe50703962cd96283e5c7 to your computer and use it in GitHub Desktop.
QueryListDemo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"jaeger/querylist": "^4.0", | |
"rmccue/requests": "^1.7", | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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