in reply to Alternative 2 WWW-Mechanize with JavaScript ?
The WWW::Mechanize docs explain that it doesn't support JavaScript. Consider using WWW::Mechanize::Firefox or super search for other alternatives, this question is asked quite frequently.