These were pagan priests and diviners who worshiped Dagon.
The Philistines wanted to know how to get rid of the ark without angering Yahweh any further.