Search Results

Search found 3 results on 1 pages for 'phpquery'.

Page 1/1 | 1 

  • Selecting peculiar XML tags with phpQuery

    - by Aristotle
    phpQuery is a really nice tool which has helped me tremendously in the past parse well-formed XHTML and XML documents, but I have recently run into a problem trying to select elements that have colons in their tagname, such as the following: <isc:thumb><![CDATA[http://example.com/foo_thumb.jpg]]></isc:thumb> I've tried to use the pq() function to select all of these elements: foreach ( pq("isc:thumb") as $thumbnail ) { print pq( $thumbnail )->text(); } Unfortunately this is doing nothing. If I try another element, like a tagname of id, the results pop up as expected.

    Read the article

  • best way to filter out non-representational elements

    - by nonano
    Hi there, I am using phpQuery in order to apply some twaks to editorial content. As its syntax is the same as jQuery, I consider this a dom scripting issue. To get rid of elements which are not representing anything, but wrapping other stuff (like the div in <div><p>blah</p></div> I came up with this selector: ['div:not([align][class][id][style][title][dir][lang][onclick][ondblclick][onmousedown] [onmouseup][onmouseover][onmousemove][onmouseout][onkeypress][onkeydown][onkeyup])'] which looks quite monstrous for a selector simply aming on Divs which just do not have any (valid) attribute. I guess there must be a more straight-forward way to accomplish that, right? Edit: Oh, and I just noticed that it even doesn't do wat I intended to ...

    Read the article

  • Convert a (nested)HTML unordered list of links to PHP array of links

    - by Klark
    Hi, I have a regular, nested HTML unordered list of links, and I'd like to scrape it with PHP and convert it to an array. The original list looks something like this: <ul> <li><a href="http://someurl.com">First item</a> <ul> <li><a href="http://someotherurl.com/">Child of First Item</a></li> <li><a href="http://someotherurl.com/">Second Child of First Item</a></li> </ul> </li> <li><a href="http://bogusurl.com">Second item</a></li> <li><a href="http://bogusurl.com">Third item</a></li> <li><a href="http://bogusurl.com">Fourth item</a></li> </ul> Any of the items can have children. (The actual screen scraping is not a problem, I can do that.) I'd like to turn this into a PHP array, of just the links, while keeping the hierarchical nature of the list. Any ideas? I've looked at using htmlsimpledom and phpQuery, which both use jQuery like syntax. But, I can't seem to get the syntax right. Thanks.

    Read the article

1