AOL Inc has agreed to buy The Huffington Post, the influential and rapidly growing news, analysis and lifestyle website, for $315 million, the struggling US Internet company announced.