in reply to Re^4: How to browse using WWW::Mechanize::Firefox
in thread How to browse using WWW::Mechanize::Firefox

WWW::Mechanize::Firefox can "click" on any page element, even if it does not appear as "link". But you will have to figure out on what elements to click, and how to identify these.

Again, I recommend using the RSS and/or ical interfaces instead. They are geared for consumption by machines such as smartphones.

  • Comment on Re^5: How to browse using WWW::Mechanize::Firefox

Replies are listed 'Best First'.
Re^6: How to browse using WWW::Mechanize::Firefox
by ckj (Chaplain) on May 29, 2012 at 11:54 UTC
    I don't know much about RSS and ical. I clicked on these links and they saved the events in my outlook calendar. While I was trying to save the report in some notepad or database. Do you have any idea about it. Also I clicked on 'list' tab and get the events list with dates but after that $mech->content doesn't gives it's content in the same way. It prints the same earlier content which was used to appear on browsing this page.

      Please learn about RSS and iCal by reading internet documentation for it. For example RSS and iCal.

      Please note that the "list view" displays differently from the "month" view. This may or may not correspond to giving the elements different class attributes. I recommend analyzing the generated HTML and debugging the Perl code.

      I won't help you with the concrete HTML scraping because the RSS and/or iCal will provide a far better solution. Please do invest the effort to learn about these formats. Likely, it will help you to learn how to speak HTTP without a browser, for example using LWP::Simple or WWW::Mechanize. Many of the RSS modules also can consume a link directly, and likely also the iCal family of modules can consume calendar information served over HTTP.

        Thanks corion, RSS was a helpful for this application and I can directly put the calendar content into my outlook calendar. But only thing I couldn't make is that after clicking Link tab the HTML contents scrapped are not the updated one, I always get the previous content. Any suggestions?
        $mech->click({ selector => '#ui-btn-calendarlist-list', synchronize => + 0 }); print $mech->content;#should fetch updated contents
        Update: On using Click function, the contents get changed on web page as according but on fetching that page using $mech->content gives previous contents.