Source: Baidu. 

Last week's cruel market didn't do any favors for Baidu (BIDU 2.30%) investors. Shares of China's leading search engine fell 7% last week, moving lower in each of the past four trading days. 

It's been a painful ride since the stock peaked at $251.99 last November. The stock begins this new trading week 39.3% below its all-time high.

The stock isn't the only thing heading lower. Wall Street profit targets have been falling on Baidu as well. Margins have taken a beating as the former dot-com darling invests in video streaming and online-to-offline, or O2O, initiatives, two fast-growing categories that are gnawing away at profitability now for the sake of potential payoffs in the future.

The sharp slide on the bottom line has blurred the bargain that Baidu stock has become these days. Earnings from continuing operations have fallen in each of this year's first two quarters, and analysts see a decline of more than 10% in adjusted earnings for all of 2015. That may not be the Baidu that growth investors thought they were buying into, but the good news is that even Wall Street pros see the margin squeeze reversing soon.

If we look past this year's lull we see some pretty encouraging growth prospects, and that makes the 39% drop in Baidu's stock that much more compelling. Baidu is now trading at 21 times next year's earnings forecast, according to S&P Capital IQ data. That's near its historical lows, but the value gets even more compelling if we look out beyond 2016. Baidu is now fetching just 14 times 2017's profit target and just 10 times the following year's earnings forecast. 

That's a long way out. It's always possible that the recent margin contraction can continue. The video and O2O efforts may take a lot longer to play out. Then again, if you think that Baidu's not going to turn things around or that it won't be able to improve on its monetization, you probably aren't an investor in Baidu or thinking about becoming one.

We can't dismiss the positive top-line contribution provided by the things that are holding Baidu's current earnings performance back.  Baidu's O2O arsenal -- its Qunar travel portal, Nuomi group-buying hub, and Baidu Takeout Delivery -- saw its gross merchandise volume more than double over the past year, and Baidu now claims that it's China's fourth largest player in the booming O2O market. Its iQiyi video portal now reaches more than 500 million users.  

Baidu remains one of the market's biggest success stories. It celebrated its 10th anniversary as a public company earlier this month, and even in its depressed state it's still a 56-bagger since going public at a split-adjusted price of $2.70 a decade ago. The correction has been rough, but the value in the stock is becoming more clear with every downtick. Baidu may not look so hot right now, but give it time.