What does ‘Carpetbagger’ mean?

A politician who is seeking election for somewhere they aren’t from or a company that profits from others misfortune.