How about using YSlow and/or Google Page Speed with Selenium.
- Create separate firefox profiles - one for Google Page Speed and one for YSlow.
- Install extensions in respective profiles
- Install Firebug for both profiles and Page Speed and YSlow in their respective profiles (extensions are installed and configured separately for each profile).
- Using Selenium load the custom profile
Read more here and here
Above links give an idea.
Hope this helps.