They were after the carriers, but the carriers weren't there, so they concentrated on the battleships and cruisers, secondary to that were parked aircraft etc. BTW they knew hitting the ships in the harbor, while damaging, would not actually completely sink them since the harbor was so shallow, and in fact the US were able to raise and return to service most of the damaged ships.
While the first wave came in and caught the US by surprise, the second wave came in, and even achieving most of their mission, they had a much tougher time with US anti-aircraft.
By the time the third wave could launch, there was no longer any chance of surprise, the Japanese had lost a number of planes, they feared losing many more to improved AA fire, and most importantly, they didn't know where the US carriers were, and that caused the Japanese admiral (who believed that the war would be short lived; they didn't think the US had the stomach to fight), to make the decision retire from the fight rather than risk being hit by an unaccounted for US carrier fleet.