I think you're probably devaluing tanks a little too much... yes, artillery could defeat them: but artillery was not stationed in the front line trenches, it was tucked away nice and safe a mile or two behind the lines. If the tanks got that far, you'd already lost the battle...
As for machine guns, IIRC the first tanks were only "semi-bulletproof", plus the Germans had a special tungsten bullet issued to snipers that could also pierce a tank's armour. Then the British made one of those stupid mistakes you often get in war; the Mark II (or was it III?) tank was intended for training purposes only, and had a mild steel body instead of actual hardened armour - but the generals were so desparate for tanks that they sent them into battle anyway. Result, massive casualties, and the Germans pretty much dismissed tanks as a useless novelty. Then the British came up with the Mark IV, which was completely bulletproof, and used it at Cambrai... and its successors were also used at Amiens, and during the 100 Days. No, they didn't "win the war" as lots of people claim - but they were an essential part of the combined arms tactics (tanks, infantry assaults, artillery barrages, gas, combat engineers, aircraft) which did beat the German army.