Continued from page 2

Those fights are part of the reason Mr. McCain had trouble securing the Republican presidential nomination, including winning less than 50 percent of Republican primary voters’ support, despite clearing the field less than halfway through the primaries.

The Times analysis found Mr. McCain’s most frequent Democratic teammates are Mr. Dorgan, with whom he shared leadership of the Indian Affairs Committee and who co-sponsored 23 of Mr. McCain’s bills, and Mr. Lieberman, who signed onto 15 McCain bills.

Mr. Obama’s most frequent Republican partners were Mr. Lugar, who co-sponsored nine Obama bills, and Sen. Norm Coleman, Minnesota Republican, who signed on to eight of Mr. Obama’s measures.

The bill on which Mr. McCain attracted the most support in the past few years was his plan to combat greenhouse-gas emissions. That bill garnered 16 co-sponsors, 14 of whom were Democrats, including Sen. Joseph R. Biden Jr., Democrats’ vice-presidential nominee. Mr. Obama himself signed onto another of Mr. McCain’s global-warming bills.

Mr. Obama’s best successes in attracting co-sponsors came on a bill to boost the union’s bargaining power with the Federal Aviation Administration, on which all 38 co-sponsors were Democrats, and a bill to issue a postage stamp honoring Mrs. Parks, which garnered 24 Democrats and 14 Republicans.

The Times study didn’t look at voting, but Congressional Quarterly conducts annual studies of senators’ voting records.

Over his Senate career, Mr. McCain has voted with the majority of Senate Republicans about 85 percent of the time, while in his three years in the Senate Mr. Obama has voted with his party 97 percent of the time.