Hi Monks,

I know its a very dumb question, When I try to fetch the page using any browser I get the result whereas when I try to fetch it using code I don't see any content.

#!usr/bin/perl -w use strict; use WWW::Mechanize; my $ua = WWW::Mechanize->new; my $base_url = 'http://search.justdial.com/srch/search_cwa.php?srch=tr +ue&city=Chennai result=&city=&searchtype=Multicuisine+Restaurants&res +ultType=&area=&new_area=&Stype=category&choices=&intermid=true&docId= +&smsAlert=&emailAlert=&NameAlert=&sinfo=&smsDetail=&img=&img_check=&s +eeAlso=&sms_visible=&sms_button=&Lowcat=&lowest=&return_page=&magic_m +obile=&magic_email=&magic_sinfo=&magic_Detail=&magic_seeAlso=&magic_n +ame=&magic_tel=&login_name=&login_pass=&login_name_review=&login_pass +_review=&img_forget=&screen_name=&login_name1=&login_pass1=&comp=&cid +=&review_div=&ADVSEARCH=&city=Chennai&txtname=&txtadd=&Street=&area=& +Pin=&txt_company=&txtphone=&jdG=&search_type_string_company=&search_t +ype_string='; $ua->cookie_jar(HTTP::Cookies->new()); $ua->default_header('User-Agent' => 'Mozilla/5.0 (Windows; U; Windows +NT 6.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.3 +8 Safari/532.0'); open(DATABASE, ">just_dial.html") || die "$!\n"; DATABASE->autoflush(1); $ua->get($base_url); print DATABASE $ua->content();

In reply to Mechanize Help by pkumar.pr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.