WWW::Mechanize is a good place to start although last time I checked you'll find no support for JS. That may not matter if the JS is just driving traditional page loads, but if the JS is doing AJAX or mucking around with the DOM then you'd have to roll your own support for that. Maybe that's the point of the previous post suggesting Selenium - I'm not familiar with that package.