<P> Wild Wild West is a 1999 American western action comedy film directed by Barry Sonnenfeld . It was written by S.S. Wilson and Brent Maddock (whose previous collaborations include the Short Circuit and Tremors franchises), along with Jeffrey Price and Peter S. Seaman . A big - screen adaptation of the 1960s TV series The Wild Wild West, it stars Will Smith, Kevin Kline, Kenneth Branagh and Salma Hayek . The film takes the steampunk gadgetry from the original series to still more fantastical lengths with a series of unlikely contraptions culminating in a giant mechanical spider . </P> <P> Wild Wild West was a commercial disappointment, earning only $222.1 million worldwide against a $170 million budget, and received predominantly negative reviews . </P> <P> In 1869, 4 years after the end of the American Civil War, U.S. Army Captain James West (Will Smith) and U.S. Marshal Artemus Gordon (Kevin Kline) hunt for Confederate General "Bloodbath" McGrath (Ted Levine), who is wanted for mass murder, throughout the Southern United States . This is due to McGrath ordering a massacre in a settlement called New Liberty, where many of the freed slaves were murdered, including West's biological parents . The search leads to a brothel where the two try (unsuccessfully) to arrest him . It leads to a huge brawl and a cart of nitroglycerin crashing into the building, starting a fire . Both West and Gordon--Gordon dressed as a woman--escape . Later, in Washington, D.C., West and Gordon meet at the White House with President Ulysses S. Grant (Kevin Kline), who tells them about the disappearance of America's key scientists and a treasonous plot by General "Bloodbath" McGrath . Grant charges the two with finding the scientists before he inaugurates the first transcontinental railroad at Promontory, Utah . </P> <P> On board their train, Gordon examines the head of a murdered scientist, using a projection device to reveal the last thing the scientist saw . Finding McGrath and a clue in the image, they head to New Orleans, pursuing a lead about Dr. Arliss Loveless (Kenneth Branagh), an ex-Confederate scientist in a steam - powered wheelchair, who is hosting a party for the elite of Southern society . West mistakes a female guest for a disguised Gordon and makes an error that results in the guests wanting to lynch West . Meanwhile, Gordon roams the mansion and comes across a caged Rita Escobar (Salma Hayek), rescuing her . Gordon frees West from the lynching with an elastic rope, and the three escape to their train The Wanderer . On board, Rita asks for their help in rescuing her father, one of the kidnapped scientists, Professor Escobar . </P>

Who played ulysses s grant in wild wild west