You can use Selenium.
In reply to Re: Mechanize with AJAX by stark in thread Mechanize with AJAX by zer