Leser: 3
|< 1 2 3 >| | 23 Einträge, 3 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl use strict; use warnings; use Web::Scraper; my $html = q~<TR> <TD align=right><INPUT type=checkbox CHECKED value="1894.252474 from(948.133513,2+) title(Elution%20from%3a%20777FinneganScanNumber%3a%202607) query(520)" name=QUE></TD> <TD alig=right><TT><I><B>948.13 </B></I></TT></TD> <TD align=right><TT><I><B>1894.25247 </B></I></TT></TD> <TD>23334455 </TD> <TD> </TD></TD></TR>~; my $parser = scraper { process 'input[type="checkbox"]', value => '@value'; }; my $result = $parser->scrape( $html ); print $result->{value};
1
2
3
4
C:\>scraper_test.pl
1894.252474 from(948.133513,2+) title(Elution%20from%3a%20777FinneganScanNumber%
3a%202607) query(520)
C:\>
Struppi+2007-10-23 10:38:56--
Trotzdem würde ich mir mehr Mühe bei der Erzeugung des HTML codes geben.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
use warnings; use HTML::Element; use HTML::TreeBuilder; my $tree = HTML::TreeBuilder->new; $tree->parse_file('C:/Documents and Settings/Issa/Desktop/test.html'); foreach my $table_row ($tree->look_down('_tag' => 'tr')) { foreach my $table_cell ($table_row->look_down('_tag' => 'td')) { #foreach my $input_field ($table_cell->look_down('_tag' => 'input')) { foreach my $input_field ($table_cell->look_down('_tag' => 'tt')) { foreach my $test ($input_field->as_text){ if ($test =~ /Met/) { print $test, "\n"; #als test ob es funzt!! foreach my $lookup ($tree->look_up('_tag'=>'tr')) { my @tags = $lookup->content_list; foreach my $tag(@tags) { print $tag->as_text; } } } } } } } print "ok!!!!!!";
|< 1 2 3 >| | 23 Einträge, 3 Seiten |