]>
Commit | Line | Data |
---|---|---|
aa016126 MG |
1 | #!/usr/bin/perl |
2 | use t::lib tests => 1; | |
67e78ff2 | 3 | |
4 | my $html =<<'EOHTML'; | |
5 | <html> | |
6 | <head> | |
7 | </head> | |
8 | <body> | |
9 | <table> | |
10 | <tr> | |
11 | <td>a <td>a <td>a <td>a | |
12 | </tr> | |
13 | <tr> | |
14 | <td>a <td>a <td id=findme>a <td>a | |
15 | </tr> | |
16 | </table> | |
17 | </body> | |
18 | </html> | |
19 | EOHTML | |
20 | ||
aa016126 MG |
21 | my $t1 = HTML::TreeBuilder->new_from_content ($html) ; |
22 | my $found = $t1->look_down(id => 'findme'); | |
67e78ff2 | 23 | |
aa016126 MG |
24 | my $pos = join ' ', $found->position; |
25 | is $pos, '-1 1 0 1 2'; |