QueryPath Parse Live Page VS Download

kjenney
kjenney used Ask the Experts™
on
I'm using QueryPath to retrieve various tags from sites. I'm using htmlqp to parse pages. My problem is that the parse fails when done remotely but works fine when the page is saved locally via curl. How can I debug the output and get the pages to process?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Kyle HamiltonData Scientist
Most Valuable Expert 2014

Commented:
does querypath do a file_get_contents first? if not, you could try that, and then parse the result.
Data Scientist
Most Valuable Expert 2014
Commented:
$url = 'http://google.com";

$htmlDoc = file_get_contents($url);

$body = htmlqp($htmlDoc, 'body');

Author

Commented:
Works great! Saves me a lot of time and coding. Thanks.
Kyle HamiltonData Scientist
Most Valuable Expert 2014

Commented:
:))

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial