Deuteronomy 12:30
28 Pay careful attention to all these things I am commanding you so that it may always go well with you and your children after you when you do what is good and right in the sight of the Lord your God. 29 When the Lord your God eliminates the nations from the place where you are headed and you dispossess them, you will settle down in their land. 30 After they have been destroyed from your presence, be careful not to be ensnared like they are; do not inquire* of their gods and say, “How do these nations serve their gods? I will do the same.” 31 You must not worship the Lord your God the way they do! For everything that is abhorrent to him, everything he hates, they have done when worshiping their gods. They even burn up their sons and daughters before their gods! 32 (13:1) You must be careful to do everything I am commanding you. Do not add to it or subtract from it!
1 Samuel 28:7
5 When Saul saw the camp of the Philistines, he was absolutely terrified. 6 So Saul inquired of the Lord, but the Lord did not answer him—not by dreams nor by Urim nor by the prophets. 7 So Saul instructed his servants, “Find me a woman who is a medium, so that I may go to her and inquire of her.” His servants replied to him, “There is a woman who is a medium in Endor.” 8 So Saul disguised himself and put on other clothing and left, accompanied by two of his men. They came to the woman at night and said, “Use your ritual pit to conjure up for me the one I tell you.” 9 But the woman said to him, “Look, you are aware of what Saul has done; he has removed the mediums and magicians from the land! Why are you trapping me so you can put me to death?”
Notes and References
"... death could be transcended in exceptional cases, but this had no obvious bearing on Israel’s life and faith. Consulting the dead through necromancy is occasionally mentioned. It was practiced by Saul (1 Samuel 28) and Manasseh (2 Kings 21:6; 2 Chronicles 33:6), but proscribed by Josiah (2 Kings 23:24). Its efficacy is undenied in the first passage, while its condemnation is clear in the second two. The relevant terms can indicate both the practitioners (“mediums, wizards”) and the spirits consulted (see 1 Samuel 28:7-9), indicating their near identity. The only historical narrative with an explicit afterlife element is that of Saul’s necromancy (1 Samuel 28), and this reveals several aspects of the practice: one could consult a named individual; only the medium saw the spirit (note 1 Samuel 28:13) Samuel’s spirit was “disturbed” (compare Isaiah 14:9 and Phoenician tomb curses). However, the story’s main interest is in the prophetic denunciation of Saul, who was about to join the defunct Samuel ..."
Arnold, Bill T. Dictionary of the Old Testament: Historical Books (pp. 217-218) InterVarsity Press, 2005