Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # You have to install HTML::TagParser and also URI::Fetch
- # For example do: sudo cpan URI::Fetch
- # And then also do: sudo cpan HTML::TagParser
- # Save this script as perlparse.pl and run perl ./perlparse.pl
- # Good luck ;)
- # Written 25.03.2017 by Security XIII
- use HTML::TagParser;
- my $url = "https://ru.aliexpress.com/item/6-12Colors-Non-toxic-Crayon-edible-baby-drawing-Supplies-ring-toy-Easy-to-erase-educational-toys/32753968959.html";
- my $tag = "j-sku-discount-price";
- my $html = HTML::TagParser->new( $url );
- my @list = $html->getElementById( $tag );
- print @list[0]->innerText;
- # In case you want to print all search results
- # foreach my $elem ( @list ) {
- # my $tagname = $elem->tagName;
- # my $attr = $elem->attributes;
- # my $text = $elem->innerText;
- # print "<$tagname";
- # foreach my $key ( sort keys %$attr ) {
- # print " $key=\"$attr->{$key}\"";
- # }
- # if ( $text eq "" ) {
- # print " />\n";
- # } else {
- # print ">$text</$tagname>\n";
- # }
- # }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement