He was elected to the Canadian House of Commons in the 1921 federal election, defeating future Conservative Prime Minister Richard Bennett by twelve votes in Calgary West. Shaw is usually considered to have been a Labour candidate but he actually ran as an independent, supported by both the United Farmers of Alberta (UFA) and the Alberta branch of the Dominion Labor Party (DLP). He attended a Progressive Party convention in 1922 and may have been a candidate for that party's leadership. But he stated his independence from all parties in 1923. During his time in parliament, Shaw was associated with the Ginger Group of radical Labour and Progressive representatives.