Obsidian Fire said:
^^Actually, he gets captured by orcs from the elves and taken all the way to Mordor, from where he escapes/is let go and travels from there to Moria. That's when Gollem learned all about the Marsh and Shelob, etc.
Sorry but that's actually wrong, you've either not read The Appendices with the events during LOTR or you have your timeline events mixed up.
Gollum met Shelob before he was captured and was found by Aragorn in the Dead Marshes when he was let go, Gollum ventured himself into Mordor by accident and was captured before he was found by Aragorn and Gandalf and after he met Shelob.
During the Council of Elrond, Legolas tells everyone that Gollum disappears after the Elves are attacked by Orcs in Mirkwood, Gollum's guard was killed and it appears the Orcs that attacked Mirkwood were there to 'rescue' him but it's never confirmed that they actually recaptured him even though there are signs he travelled with the Orcs, but he escapes from them at some point and is not taken back to Mordor, rather he goes to Moria supposedly to escape both the elves and Sauron's servants. Gollum also tells Frodo during TTT that he has been actually inside Mordor only once and it was by accident when Frodo asks him to lead them there.
Here's the extracts from the Appendices also concerning Gollum which confirm this.
2980:Gollum reaches the confines of Mordor and becomes aquainted with Shelob.
3009-3017: Gandalf and Aragorn renew their hunt for Gollum at intervals during the next eight years searching in the vales of Anduin, Mirkwood, Rhovanion to the confines of Mordor. At some time during these years Gollum himself ventured into Mordor and was caputured by Sauron
3017:Gollum is released from Mordor. He is taken by Aragorn in the Dead Marshes and brought to Mirkwood.
June 20 3018: Sauron attacks Osgiliath. About the same time, Thranduil is attacked, and Gollum Escapes.
August 3018
All Trace of Gollum is lost. It is thought that at about this time, being hunted both by the Elves and Sauron's servants, he took refuge in Moria; but when he had at last discovered the way to the West-Gate he could not get out.