duzun / hQuery.php

An extremely fast web scraper that parses megabytes of invalid HTML in a blink of an eye. PHP5.3+, no dependencies.
https://duzun.me/playground/hquery
MIT License
361 stars 74 forks source link

How to find all a->href's inside a table listing? #20

Closed amjithps closed 7 years ago

duzun commented 7 years ago
// After initializing $doc =  hQuery::fromUrl('http://example.com/someDoc.html');
// Check README.MD
$listOfA = $doc->find('table a');
$listOfHrefs = [];
foreach($listOfA as $a) $listOfHrefs[] = $a->href;

return $listOfHrefs;