If the Spanish-American War never occurred, would Japan attack the Spanish Philippines instead of Russia in 1905?
Short answerNot necessarily; Japan's conflict with Russia still has strong causes, and Spain might simply sell the Philippines to Japan rather than fight to retain them.
NotesThe Russo-Japanese War grew from concrete conflicts over Korea, China, and the Kuril region rather than from an arbitrary Japanese search for a target. By 1905 Japan also had an alliance with Britain that constrained possible French intervention on Russia's behalf. If Spain still held the Philippines, Japan might pursue both its Russian dispute and Philippine acquisition rather than substitute one war for the other. Purchase is the likelier route because Spain could be willing to sell a costly and difficult colony, turning an expected confrontation into a very expensive negotiation.