how to resolve Cannot call method "getTable" on an undefined value on windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anuja T
    New Member
    • Jan 2012
    • 12

    how to resolve Cannot call method "getTable" on an undefined value on windows

    I m getting error in calling getTable() method.
    Line is:-
    my $table_object=m y $ff->getTable("id:" , "ctl00_ContentP laceHolder1_gri dAMID");

    suggest way to resolve it.
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    That error message is telling you that $ff isn't defined. You need to check the code where $ff is defined/assigned and find out why it failed.

    Also, you have an extra 'my' in that statement which will also cause a problem (possibly relating to this error) and it should be removed.

    Comment

    • numberwhun
      Recognized Expert Moderator Specialist
      • May 2007
      • 3467

      #3
      When you are asking us to troubleshoot your code, it is more helpful to include all of the code, that way we can follow the code and better determine where you error might be.

      Regards,

      Jeff

      Comment

      • Anuja T
        New Member
        • Jan 2012
        • 12

        #4
        Here is my code:-
        $sel->wait_for_page_ to_load_ok("100 000");
        $sel->wait_for_page_ to_load_ok("100 000");
        my $html_file=getT able("(Website name)");

        my $te = new HTML::TableExtr act();
        $te->parse($html_fi le);
        my @tables = $te->tables;
        my $table_count = scalar @tables;
        print "tables count:$table_co unt\n";


        $te = HTML::TableExtr act->new( depth => 1, count => 1 );
        #$te = new HTML::TableExtr act( attribs => { id => 'TABLE1' } );
        print"Got depth n count...\n";
        $te->parse(get $ARGV[0] || get $html_file);
        print"Got HTML file...";
        foreach $ts ($te->tables)
        {
        print "M inside 1st loop...\n";
        print "Table found at ", join(',', $ts->coords), ":\n";
        foreach $row ($ts->rows)
        {
        print"M inside 2nd loop...\n";
        print " ", join(',', @$row), "\n";
        }



        And another issue is "its not entering into loop."

        Comment

        • chorny
          Recognized Expert New Member
          • Jan 2008
          • 80

          #5
          I don't see any getTable method call in your code.

          As for loop, you can use tables_report method of HTML::TableExtr act to see if htere are any tables.

          Comment

          Working...