The Sri Lankan Parliament on Wednesday voted to elect the successor to Gotabaya Rajapaksa in a three-way contest, following a high-voltage political drama that saw the former president fleeing the country and resigning after a popular uprising against his government for mismanaging the economy.