in reply to Re: Proper use of HTML::Form for exctracting
in thread Proper use of HTML::Form for exctracting

Where is my mistake . Please advice me !

Method calls are not interpolated. If you move the method call outside the string it will actually be called. Here's an example as an SSCCE for which I've obviously replaced your private URL with a public one (I've also fixed the arguments to the gethtml method, your reversed closing tags, removed the indirect object notation and removed the unmatched <p1> element).

#!/usr/bin/perl use strict; use warnings; use HTML::Extract; my $extractor = HTML::Extract->new; print "Content-type: text/html\n\n"; print "<html><body>\n"; print $extractor->gethtml('http://perlsphere.net/', 'tagname=body', 'returntype=text'); print "</body></html>";

This could still be improved further but at least it shows you some working code. Enjoy.

Replies are listed 'Best First'.
Re^3: Proper use of HTML::Extract for extracting
by bachoA4o (Sexton) on Aug 27, 2018 at 13:00 UTC
    Thank you ! This helped a lot. But it returns the whole content of the web page. I've tried to change tagname=body to tagname=form but it only returns blank page

      Are you expecting to see the text you typed into the input box from this page ?

      <!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> <form name="MyForm" action="/cgi-bin/ex.cgi",method="post",id="f1"> <input type="text" name="textfield"> </form> </body> </html>

      Why don't you want to use the CGI module ?

      poj
        Yes ,that's what I want to do. I didn't use CGI.pm because i thought it's not being used anymore (correct me if i'm wrong i'm new in perl)

      there is no form tag on perlsphere.net.