The U.S. presidential election is fast approaching, and depending on the results of the race, stocks could immediately enjoy a boost or quickly start to dive. But beyond the typical immediate post-election reaction of the market, the different visions and proposed policies of the two candidates will affect sectors of the economy differently in the long term. For instance, if the Democratic nominee Joe Biden wins, companies in the renewable energy industry are likely to thrive. Meanwhile, a second term for President Donald Trump would be good news for companies in the oil industry.

There are more areas in which both candidates' visions diverge, but there are also industries -- such as the pharmaceutical and e-commerce sectors -- that will navigate the next four years reasonably well regardless of who wins The White House. After all, developing life-saving drugs never goes out of style, and customers will continue to shop online as the pandemic drags on -- and beyond. Two companies worth buying in that spirit are Johnson & Johnson (NYSE:JNJ) and Etsy (NASDAQ:ETSY). Let's look closer into why both stocks are worth investor attention, regardless of Tuesday's outcome. 

^SPX Chart

^SPX data by YCharts

1. Johnson & Johnson 

Johnson & Johnson has a long and storied history as a drugmaker. Along with a rich portfolio of medical device products and well known brands like Band-Aid and Aveeno, Johnson and Johnson manufactures and markets more than 67 drugs in the U.S. alone. One of the company's best-selling drugs is Stelara, a plaque psoriasis treatment. During the company's third quarter ended Sept. 30, the drug generated sales of $1.9 billion, 14.7% higher than the year-ago period. 

During the third quarter, sales of Johnson & Johnson's cancer treatment Darzalex jumped by 43.8% to $1.1 billion, while revenue from Imbruvica, also a cancer therapy, came in at roughly $1 billion, 11.9% more than the third quarter of the previous fiscal year. These drugs are just the tip of the iceberg for Johnson & Johnson. In total, the company's pharmaceuticals segment reported sales of $11.4 billion, a 5% year-over-year increase, despite the pandemic's negative impact on sales.

Smiling male pharmacist wearing a lab coat and leaning on pharmacy counter.

Image source: Getty Images.

In the meantime, the company is working on its late-stage pipeline, which features more than two dozen ongoing clinical trials. Johnson & Johnson has two other segments that help diversify its revenue base. There is the company's consumer healthcare business, which offers over-the-counter (OTC) products, and its medical devices segment. Revenue from its consumer healthcare segment grew by 1.3% year over year to $3.5 billion during the third quarter.

Johnson & Johnson's medical devices business, which has arguably been the hardest hit by the crisis, saw its sales of $6.2 billion 3.6% below levels from last year's third quarter. Despite the headwinds, Johnson & Johnson's revenue increased slightly by 1.7% year over year to $21.1 billion. Meanwhile, its non-GAAP net income increased by 3.5% to $5.9 billion.

Johnson & Johnson also pays a nice dividend that it has raised for more than 50 years in a row, earning it the title of Dividend Aristocrat. The company currently offers a 2.8% dividend yield -- compared to an average of 1.8% for the S&P 500 -- and it has a reasonable cash payout ratio of 56.4%. Johnson & Johnson's stellar history, its strong presence in the pharmaceutical and consumer healthcare spaces, and its ability to continue developing lucrative products make it a good stock to buy and hold in your portfolio for a long time, regardless of who wins the election.

2. Etsy

The competition is fierce in the e-commerce industry, but Etsy has managed to carve out a niche. The company's platform is the go-to place for those looking to buy and sell handmade, specialized, and antique goods.

According to a 2019 company poll, 88% of buyers on the platform agreed that it features items that couldn't be found anywhere else. This is one of the main reasons why the company's popularity continues to grow. During its third quarter ended Sept. 30, the number of active sellers on Etsy's platform rose by 42% year over year to a little under 3.7 million. Etsy's active buyers soared by 55.4% to roughly 69.6 million.

The company's gross merchandise sales (GMS) -- the total dollar value of goods sold on its platform -- jumped by 119.4% year over year to $2.6 billion. It shouldn't be a surprise then, that Etsy's top and bottom lines were also impressive. The company's revenue came in at $451.5 million, 128.1% higher than the prior-year quarter, and it recorded a net income of $91.8 million, a whopping 520% increase compared to last year's third quarter.

Man wearing glasses sits on couch, holding a credit card, in front of his laptop. TV and bookcase in the living room background.

Image source: Getty Images

While the pandemic is helping Etsy's business, the company's growth prospects don't hinge on the crisis that's kept everyone shopping at home. Etsy is constantly looking to improve its platform by tweaking its search algorithms to attract more users, and expanding its presence in international markets. During the third quarter, the company generated 63% of its GMS in the U.S. The opportunities abroad are aplenty, and Etsy is looking to benefit.

It is doing so in several ways, for instance, by ramping up its marketing efforts. Etsy started a TV commercial campaign in international markets at the end of 2019 after similar efforts had proved successful in the U.S. Recently, the company announced it was rolling out Etsy Payments -- which allows sellers to provide more payment options to their buyers -- to several new countries, including Mexico and Israel. Offering more payment options to clients can attract more sellers to the platform.

In another exciting development, the company acquired Reverb -- an online marketplace for new, used, and vintage musical instruments -- for $275 million in cash last year. The deal closed in August 2019, and promised to act as another growth driver for the company.

Etsy estimated the entire online market for special goods to be worth $170 billion, meaning it has barely scratched the surface of its space. Investors can expect Etsy to continue its rapid growth and beat the market for years to come. 

Keep calm and invest on

Investors don't like uncertainty, which is precisely what a presidential election generates -- especially one as contentious as ours at present. But whatever happens in the immediate aftermath of the race, it's essential to remember that some industries will continue to thrive in spite of changes in the political landscape. Johnson & Johnson and Etsy each belong to such industries.

The latter is one of the largest healthcare companies in the world, with a strong presence across the pharmaceutical industry, the medical devices space, and the consumer healthcare market. Etsy is a growing e-commerce specialist which could benefit from strong tailwinds that will catapult its stock higher for many years to come. You can hold both of these great stock picks through these uncertain times and beyond.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.