Shaw held several local offices in Exeter, New Hampshire before he was elected as a Democrat to the Twenty-sixth and Twenty-seventh Congresses (March 4, 1839 – March 3, 1843).
Before being elected to the Twenty-sixth and Twenty-seventh Congresses (March 4, 1839 – March 3, 1843) as a Democrat, Shaw held various local offices in Exeter, New Hampshire.