Investors took profits on recent gains in U.S. stocks on Wednesday, but a last-minute rise in Bank of America helped lift the Dow to its eighth straight day of gains.

Investors remain confident that solid corporate earnings will inspire further advances, but a recent string of lightly traded sessions raises worries that buying interest at these levels has dried up.

Energy and materials stocks weighed on indexes, pressured by weakness in emerging markets, a source of heavy demand for raw goods. Chevron Corp was the weakest stock on the Dow, falling 1.5 percent to $96.24, followed by Alcoa , off 1.4 percent to $17.16. The Morgan Stanley commodity-related equity index <.CRX> fell 1 percent.

(Reporting by Edward Krudy; Editing by Leslie Adler)