Parsing class with embedded space/nedbie help

12 views
Skip to first unread message

George

unread,
Aug 10, 2009, 4:29:47 PM8/10/09
to phpQuery
I am trying to use phpQuery to parse
http://fundrace.huffingtonpost.com/neighbors.php?type=city&city=phoenix&search=Search&newest=0
and store its results in a .csv file.

One of the fields required is the <span class="amt count"> If I
renamed this as amt_count, I can pull all of the values no problem,
however, if I leave it unchanged, I get nothing.

I have tried embedding the space as %20 and "\ " as well.

Now - my newbie question ... With the URL above, ideally I would like
to loop through each div with the .rep class

<?
require_once 'phpQuery.php';
$doc = phpQuery::newDocumentFileHTML('test.html');
phpQuery::$debug = 1;
$div = array();
foreach ($doc['.rep'] as $line) {
$doc2 =phpQuery::newDocumentHTML($line);
print $doc2['.icon_column_name'];
}
?>

Am I way off base here? ~~Clueless

Dougal Campbell

unread,
Aug 10, 2009, 5:40:23 PM8/10/09
to phpq...@googlegroups.com
On Aug 10 2009 4:29 PM, George wrote:
> One of the fields required is the<span class="amt count"> If I
> renamed this as amt_count, I can pull all of the values no problem,
> however, if I leave it unchanged, I get nothing.
>
> I have tried embedding the space as %20 and "\ " as well.
>

To get that element, use 'span.amt.count' as your selector.

--
Dougal Campbell <dou...@gunters.org>
http://dougal.gunters.org/
http://twitter.com/dougal
http://twitual.com/

Reply all
Reply to author
Forward
0 new messages