SAN JOSE, Calif. — The San Jose Sharks’ pop-gun offense continued its early season struggles as the Boston Bruins skated out of SAP Center with a 3-1 win on Saturday night.

San Jose managed 20 unproductive shots in the final two periods after putting 17 on goal in the first period as Bruins backup goalie Anton Khudobin beat San Jose the second time this season.

The Sharks have lost consecutive games and the Bruins have won two in a row.

Rookie Danton Heinen scored his fourth of the season — and third against San Jose — at 14:09 of the third period to put it away. He gained a step on Sharks forward Timo Meier to tap in a cross-ice feed from a rushing Kevan Miller past goalie Aaron Dell.

The Sharks had to be disappointed going into the locker room down 2-1 at the first intermission after outshooting the Bruins 17-5 and having yet another goal overturned.

Joonas Donskoi was ruled to have gloved a high rebound of Joe Pavelski’s backhand shot from the slot past Kholdobin just 62 seconds after the opening faceoff. That made three straight San Jose goals overturned by video review over two games.

But Timo Meier’s second of the season, following great work by teammate Danny O’Regan behind the net during his season debut, at 4:50 stood for a 1-0 lead. O’Regan fished the puck out on the end boards from Boston’s Brandon O’Gara and whipped a backhand pass across the crease to an open Meier.

Boston had an answer, however. Peter Cehlarik scored his first career goal by following Jake DeBrusk’s shot at 6:17. The Sharks challenged, but the situation room in Toronto judged DeBrusk collided with Dell after getting tripped by Joakin Ryan. Dell was in the net and in no position to stop the rebound shot.

Then DeBrusk scored on a breakaway at 10:46 as a San Jose power play was ending. Defenseman Brent Burns got caught in the Boston end and DeBrusk put a shot over Dell’s right blocker after corraling a long pass that caromed off the glass courtesy of Bruins defenseman Charlie McAvoy.

NOTES: The battle of backup goalies featured Boston’s Anton Khudobin with a career 3-1 record, 0.99 goals-against average and .967 save percentage against San Jose, which countered with Aaron Dell, who was coming off a career-best 41 saves and a shutout over Vancouver on Nov. 11. ... D Torey Krug missed his second straight game with an upper-body injury. The Bruins continue to play without LW Brad Marchand (undisclosed), LW Anders Bjork (undisclosed), D Adam McQuaid (broken leg), C Ryan Spooner (groin) and RW David Backes (colon surgery). ...... San Jose F Barclay Goodrow was placed in injured reserve with a bruised sternum. F Daniel O’Regan was recalled from the Barracuda of the AHL and made his season debut centering the fourth line. ... D Paul Martin (ankle) missed his 15th straight game, but he says he’s ready to go. C Ryan Carpenter, RW Kevin Labanc and D Dylan DeMelo were healthy scratches for San Jose. LW Kenny Agostino and LW Matt Beleskey did not dress for Boston.