Skip to content

Instantly share code, notes, and snippets.

@khoand0000
Created September 9, 2014 19:20
Show Gist options
  • Save khoand0000/2079772f448618715d0b to your computer and use it in GitHub Desktop.
Save khoand0000/2079772f448618715d0b to your computer and use it in GitHub Desktop.
How to use phpQuery
<?php
/**
* User: videde
* Date: 8/21/13
* Time: 1:41 AM
*/
require('phpQuery/phpQuery.php');
function action() {
$content = ""; // content of web page
$doc = phpQuery::newDocument($content);
$as = pq('a.rg_l');
foreach($as as $a) {
$href = pq($a)->attr('href');
$divs = pq('div', $a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment