The media are taking a rightful beating for failing to adequately grasp and report on the anger and frustration in rural and suburban America that propelled Donald Trump into the White House.

Most polls and pundits - including myself - thought Hillary Clinton was going to win the election. We were wrong, but one person in particular got it right.

Michael Moore, the rumpled documentary filmmaker and author, predicted Trump would get elected by winning four key traditionally Democratic-leaning states - Pennsylvania, Ohio, Michigan, and Wisconsin. Moore, who was born in Flint, Mich., and still resides in the Wolverine State, had a better pulse on the mood of Middle America than the media.

"Trump's election is going to be the biggest 'f- you' ever recorded in human history - and it will feel good," Moore said almost two weeks before the election.

It remains to be seen how good Trump's supporters will feel about him in the coming years if he alone can't "fix it." I would be happy to be wrong about the many reasons why Trump is bad and dangerous for everyone, including his supporters.

For now, Trump's supporters are ecstatic. They stuck it to the establishment, which includes career politicians, Wall Street bankers, and the mainstream media.

Glenn Greenwald, who won a Pulitzer Prize for reporting on Edward Snowden's release of classified documents that exposed surveillance programs by the National Security Agency, said the media failed to learn any lessons from Brexit, the June referendum in which mostly older, working-class voters in the United Kingdom rocked the British establishment by voting to withdraw from the European Union.

"Opinion-making elites were so clustered, so incestuous, so far removed from the people who would decide this election - so contemptuous of them - that they were not only incapable of seeing the trends toward Trump but were unwittingly accelerating those trends with their own condescending, self-glorifying behavior," Greenwald wrote.

Fair point. But there is a difference between opinion writers making a case against Trump and reporters who cover events and do enterprise work. To be sure, the media did a poor job of going to small towns and listening to Trump's supporters. But there was a lot of excellent reporting on both candidates, including the Washington Post's investigation of Trump's foundation. The New York Times detailed how Trump avoided paying federal income taxes for years, and broke the story about Hillary Clinton's use of a private email server, which dogged her campaign.

The media are not perfect and can always do better. But the media are also not a monolith. There are network and cable TV stations, newspapers, magazines, and digital-only sites. The depth and quality of reporting differs within each platform and individual outlet.

Cable TV gave Trump loads of free and unchecked airtime during the primaries. By March, he had earned close to $2 billion worth of media attention, according to mediaQuant, a firm that tracks media coverage of candidates. By comparison, Clinton received $746 million during the same period.

CBS chairman Les Moonves said in February that Trump "may not be good for America, but it's damn good for CBS." Moonves called the campaign "a circus," but said "the money's rolling in."

Since the beginning of 2016, the Big Three networks of ABC, CBS, and NBC devoted just 32 minutes to issues coverage, according to the Tyndall Report, which monitors the nightly newscasts. By comparison, the newscasts devoted nearly three times more airtime to Clinton's email controversy.

That's better than Fox News, which covered the email story as if it were Armageddon, and just made up news. Fox anchor Bret Baier reported days before the election that an indictment was likely to come from the FBI's investigation of the Clinton Foundation interactions with the State Department. The story was bogus, and he later apologized.

Trump's pal Sean Hannity used his radio show to falsely claim President Obama, first lady Michelle Obama, and Massachusetts Sen. Elizabeth Warren had removed references to Clinton from their Twitter accounts after the FBI announced it was reopening the investigation into her emails. Hannity later issued a correction on Twitter.

The bigger challenge for the media is that with the rise of the internet, information has been balkanized. While more information is available than ever before, many people are less informed. Trump showed that facts and policy don't matter.

Readers go to outlets that affirm their beliefs - even if the information is bogus. Facebook is full of fake stories such as "The pope endorses Trump" to "Hillary's illegal email just killed its first American spy." This is a serious problem, considering 44 percent of Americans get their news from Facebook, according to the Pew Research Center.

Reporters have a responsibility to get stories right. But readers now must also work to sift through the flood of information to distinguish between quality reporting, informed opinion, and junk.

Paul Davies is deputy editorial page editor for the Inquirer. pdavies@phillynews.com215-854-2556