Unless you’ve been living under a rock, you know that retail stocks have been getting pounded in 2017.

Just in the last couple of days, the stocks of Michael Kors (KORS) and Express, Inc. (EXPR) have fallen off a cliff. Meanwhile, Amazon.com recently hit $1,000 for the first time and is riding a strong uptrend.

The Amazonization of shopping has acted as a major headwind for large traditional retailers. Remember Blockbuster? Your kids sure don’t!

Mall REITS have been under assault, and big retailers like Macy’s (M) and Dick’s Sporting Goods (DKS) have seen their shares drop like rocks.

Same-store sales metrics are under pressure, inventory builds have led to greater discounting and hammered margins, so the financial outlook for old-school retail just isn’t that bright.

It’s fugly out there!

But sometimes ugly stocks make beautiful investments.

After all, most of these stocks aren’t going to zero… Consumers are still going to buy Under Armour (UA) sneakers and Ralph Lauren (RL) polo shirts. They just aren’t going to do it at Dick’s Sporting Goods or Macy’s.

Meanwhile, there are three things investors can do to take advantage of the coming bargains in the retail sector.

1. Don’t catch a falling knife. Most retail stocks are in sharp downtrends. Stocks often overreact in either direction and move much farther than the fundamentals suggest. What goes down can continue to go down longer and faster than is justified. You don’t have to like it, but it is what it is.

Patience here will pay off. While waiting for value investors to accumulate shares (such as up days where the volume is much higher than average), you can start to build your list of potential positions. Let the market come to you.

2. Avoid the big-box retailers and mall REITs. It’s very possible that the mall could go the way of the dodo bird. It’s a lot easier to sit in your underwear and, in a few clicks, buy what you need and have it delivered to your house. No need to deal with parking during the holidays either! Many of the mall REITS offer attractive dividend yields, but that could be a pure value trap. Sometimes stocks have high yields for a reason – and it’s not because business is good.