Created
March 3, 2014 02:06
-
-
Save technosophos/9317295 to your computer and use it in GitHub Desktop.
QueryPath issue #133: Attempt to reproduce.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once "vendor/autoload.php"; | |
| $HTML = <<<EOL | |
| <html> | |
| <head> | |
| <title>Foo</title> | |
| </head> | |
| <body> | |
| <p>foo</p> | |
| <ul id="one"> | |
| <li>One <p>Inner</p></li> | |
| <li>Two</li> | |
| <li>Three</li> | |
| </ul> | |
| </body> | |
| </html> | |
| EOL; | |
| $qp = htmlqp($HTML); | |
| print '==== HTML' . PHP_EOL; | |
| print $qp->find('html')->html(); | |
| print PHP_EOL . '==== :eq(1)' . PHP_EOL; | |
| print $qp->find('body li:eq(1)')->html(); | |
| print PHP_EOL . '==== :first' . PHP_EOL; | |
| print $qp->find('body li:first')->html(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment