No, the goblins did not get Gandalf. Bilbo's yell when he discovered the goblins stealing things was enough to prevent him from being captured. Gandalf killed a number of the goblins with a big flash of lightening.
Chat with our AI personalities
No they did not capture him. Bilbo's shriek was enough to allow him to escape and later rescue the party.
No in the book they did not capture him. Bilbo's shriek was enough to allow him to escape killing several goblins in the process and later rescue the party.
Beorn?
the lord of the eagles, and somewhat gandalf
Gandalf knows the Lord of the Eagles. He speaks to them, and the eagles save them. Another reason is because they do not enjoy the goblins.
The cave was dry and unoccupied. What they didn't know was that it was the 'front door' for the goblins living in the mountain. The goblins discovered them and captured them, but not before Bilbo shouted a warning that allowed Gandalf to escape capture and ultimately rescue them.
After escaping the Goblins initially during the first attack, he follows the Goblins and their captives to the Goblintown. When the Great Goblin was about to attack Thorin, Gandalf revealed himself, drawing his sword, Glamdring, white emitted burning, white sparks that burned into the Goblins around him. He slew the Great Goblin and led the Dwarves out of the tunnels in the confusion, Bilbo accidentally getting lost along the way out.