The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
=pod

=encoding utf8

=head1 NAME

L<Novel::Robot::Browser> 

get/post url, return unicode content, auto detect CJK charset

自动化获取网页内容,并解码为unicode,主要是自动检测网页的中文字符集

=head1 FUNCTION

=head2 request_url
  
    my $browser = Novel::Robot::Browser->new();
	
=head3  get

    my $url = 'http://www.jjwxc.net/onebook.php?novelid=2456';
    my $content_get_ref = $browser->request_url($url);

=head3  post

    my $form_url = 'http://www.jjwxc.net/search.php';
    my $post_data = {
		'key1' => 'value1', 
		'key2' => 'value2', 
    };
    my $content_post_ref = $browser->request_url($form_url, $post_data);

=head2 request_urls

    my $url = 'http://www.jjwxc.net/onebook.php?novelid=14089';
    my $res = $browser->request_urls( $url, 
        #post_data => ...,
        info_sub => sub { 
            my ($html_ref) = @_; 
            # ...
        }, 
        url_list_sub => sub {
            my ($src_arr) = @_; 
            # ...
        }, 
        #min_item_num => ..., 
        #max_item_num => ..., 
        content_sub => sub { 
            my ($html_ref) = @_; 
            # ...
        }, 
    ); 

=head2 request_urls_iter 

    my $url = 'http://bbs.jjwxc.net/showmsg.php?board=153&id=57';
    my ($info, $url_list) = $browser->request_urls_iter( $url, 
            #post_data => ..., 
            #min_page_num=> ..., 
            #max_page_num=> ..., 
            info_sub => sub { 
                my ($html_ref) = @_; 
                # ...
            }, 
            content_sub => sub { 
                my ($html_ref) = @_; 
                # ...
            }, 
            item_sub => sub {
                my ($h) = @_; 
                # ...
            }, 
            next_url_sub => sub { 
                my ($start_url, $i, $html_ref) = @_; 
                # ...
            }, 
            #url_list_sub => sub { 
            #    my ($html_ref) = @_; 
            #    # ...
            #}, 
            stop_sub => sub { 
                my ($info, $data_list, $i, %o) = @_; 
                # ...
            }, 
            );

=head2 set_cookie
    
    $browser->set_cookie($cookie);

=head2 read_moz_cookie
    
    $browser->read_moz_cookie($mozilla_cookies_sqlite_file, $domain);

=head2 clear_cookie
    
    $browser->clear_cookie();

=cut