chella2104@gmail.com has asked for the wisdom of the Perl Monks concerning the following question:

This is my code

use strict; use warnings; use feature 'say'; use Mojo; my $ua = Mojo::UserAgent->new; my $array = $ua->get('http://www.sqlite.org/expridx.html')->res->dom- +>find('div > p ')->map('all_text')->join("\n"); print "\n$array\n";

In this code only p tag value But I want p tag value with ul tag value

Please check this link http://www.sqlite.org/expridx.html

Can Anyone help me ??

Replies are listed 'Best First'.
Re: how to print div tag value with ul and ol tag value
by Corion (Patriarch) on Jan 13, 2016 at 09:09 UTC

    What nodes do you expect

    ->find('div > p ')

    to find?

    Maybe now is a good time to learn about Mojo.

      Thank u for your reply .

      That code is print only p tag value not li tag value pls check this link

      http://www.sqlite.org/expridx.html

      In my code output is like

      Normally, an SQL index references columns of a table. But an ..............There are certain reasonable restrictions on expressions that appear in CREATE INDEX statements: ........

      The code not find ul tag values

        How does your reply adress my question? Read Mojo::DOM about the ->find method.

Re: how to print div tag value with ul and ol tag value
by Anonymous Monk on Jan 13, 2016 at 09:53 UTC
Re: how to print div tag value with ul and ol tag value
by natxo (Scribe) on Jan 13, 2016 at 22:21 UTC
    is this what you want (oneliner)?

    $ perl -Mojo -E 'say g("http://www.sqlite.org/expridx.html")->dom->fin +d("p, ul")->map("all_text")->join("\n\n")'
    I get both the p and ul elements.