NEW YORK (TheStreet) -- Shares of Caterpillar (CAT) were soaring by 7.35% to $90.88 in early afternoon trading on Wednesday, after Republican candidate and U.S. infrastructure supporter Donald Trump beat out Democratic candidate Hillary Clinton in the U.S. presidential election on Tuesday. 

The construction equipment maker is benefiting from the anticipation that Trump will put funds toward U.S. infrastructure, TheStreet's Jim Cramer said on CNBC's "Squawk on the Street" this morning. Trump said he wants to spend $1 trillion on infrastructure.

Caterpillar recently said "China's better, U.S. is not good" so this infrastructure spend could make a "great situation" for the company, Cramer said. 

However, when trade wars begin and Europe takes a hit, people will be asking, "Why did I buy a machinery company in an atmosphere of Smoot-Hawley and tariffs?" Cramer pointed out. The Smoot-Hawley Tariff Act of 1930 increased import duties by as much as 50% to help protect U.S. farmers, but also inspired other countries to increase their own tariffs. 

It's "insanity" to buy Caterpillar at these levels because President Obama is still in office, so the infrastructure plans aren't happening tomorrow, he pointed out. However, a number of investors were short on this stock because it was a way "to play" the expected Clinton victory, which would have represented "business as usual."

Another example is United Rentals (URI), which is soaring by 14.23% to $86.67 this afternoon because infrastructure plans will require tractor rentals, Cramer said. While "I can make a case over the course of the next five months" that the stock will go up a lot, "I fear" that later this week when we're not talking as "granularly" about this, investors will wonder why they bought this stock. 

If you liked this article you might like

Crazy Weak U.S. Dollar Will Make These 10 Companies Huge Winners

Caterpillar Leads Dow to Records, S&P 500 Also at All-Time Highs

S&P 500 and Dow Score Records With Wall Street Upbeat Ahead of Fed

S&P 500 and Dow on Track for Records With Markets in Good Mood Ahead of Fed

Jim Cramer on Nvidia, Caterpillar, Facebook, HP Enterprise, Autozone and FedEx