No, the Pharisees and scribes were not baptized (immersed) by John.
Matt. 3:7-12 from Young's Literal Translation (YLT):
"7 And having seen many of the Pharisees and Sadducees coming about his baptism, he said to them, `Brood of vipers! who did shew you to flee from the coming wrath?
8 bear, therefore, fruits worthy of the reformation,
9 and do not think to say in yourselves, A father we have -- Abraham, for I say to you, that God is able out of these stones to raise children to Abraham,
10 and now also, the axe unto the root of the trees is laid, every tree therefore not bearing good fruit is hewn down, and to fire is cast.
11 `I indeed do baptize you with water to reformation, but he who after me is coming is mightier than I, of whom I am not worthy to bear the sandals, he shall baptize you with the Holy Spirit and with fire,
12 whose fan [is] in his hand, and he will thoroughly cleanse his floor, and will gather his wheat to the storehouse, but the chaff he will burn with fire unquenchable.'"
There exists a great deal of confusion over these verses for a couple of reasons: the misunderstandings taught about Acts 2:38-39, and because of a lack of understanding of the judgment language surrounding the word "fire".
The "you" in verse 11 collectively addressed the crowd who were all standing before John, and witnessing the immersions (baptisms) he performed in the Jordan river. Vs. 7 explains that the Pharisees came to look at what John was doing. They wanted to see it for themselves.
In their world, during the second temple period, if any teacher went against the Torah as interpreted by the Sadducee elders and the Sanhedrin, the "false" teacher was usually / eventually brought before the "bench" or court for inquiry. If the Sanhedrin found the false teacher guilty of transgressing the teaching of the "Law", then they were put through a process which could first result in a short period of excommunication of a day or 30 days. If the transgressor did not make the proper sacrifice / payment of fine, or if the "sin" was grave enough then the sentence of excommunication would become "anathema" / accursed for a lifetime. See: here and here.
The anathematized were considered spiritually dead to the congregation. They were ostracized completely, put out of the synagogue and out of the market place. They could not make a living, sell anything, or buy anything from even their family. The full anathema could and often did result in physical death.
This fully explains what Christ said in Matt. 10:34-36,
34 `Ye may not suppose that I came to put peace on the earth; I did not come to put peace, but a sword;
35 for I came to set a man at variance against his father, and a daughter against her mother, and a daughter-in-law against her mother-in-law,
36 and the enemies of a man are those of his household." (YLT)
With this background, we can then see why the Pharisees and scribes were inspecting John. They were unbelievers, whom John called "vipers" in Matt. 3:7, and who put all of their trust in their lineage to Abraham (Matt. 3:9).
Whereas John could and would immerse them in the water (baptize) if they were believers, he was promising them the alternative of the judgment of Christ because they were unbelievers. Matt. 3:10-12 spelled out the consequences of their unbelief. As such, John was not speaking of water baptism (immersion) for their salvation, but of immersion into the fire of God's judgment which was promised to be poured out from the Holy Spirit and Christ upon those wicked of that generation (Matt. 12:41; 23:36; 24:34) of the 1st century AD, which judgment was fulfilled at the destruction of the temple in AD 70.
Whenever we see the word "fire" in the NT we need to reach back to its use / meaning in the OT. Fire was associated with God's fury (Lam. 2:4) and with his judgment and destruction of the wicked (Gen 19:28; Isa. 9:19; 29:6; 33:11-14; 42:25; and many others). The fire John promised them was that of destruction, not salvation.
The baptism of that judgment would have been more evident if the Greek word "batizo" (Strong's Gr. 907) had been correctly translated as immersed, dipped under, submerged.
The transliteration of that word into the English translations causes much confusion. John was promising them immersion into God's destructive fire and judgment. He was using the figurative judgment language of OT prophesy. He was not promising them salvation.
For more discussion of the judgment language of the OT see my posts "It's Not The End of The World" Parts III & IV at my site: ShreddingTheVeil. See also Part VIII for more discussion from the scriptures on the pouring out of the Holy Spirit.
Further reading: Judicial Proceedings in New Testament Times by Roy Stewart.
Bold emphasis is mine.