There are many ways for a user to ‘get’ text which is displayed to them. Selecting it and copying it, and if that doesn’t work, DOM.
I want a safe, secure way to stop the user, who might be a bot, from getting content inside a div.
What measures should I use to enforce this? Is it even possible?
It really isn’t possible. Anything sent to the browser is available to the user. Capturing keystrokes and certain events (maybe
oncopyor something “similar”) can help, but there will always be a way that you can’t actually control. Some developers try to disable right clicking on the page (to prevent copying, or viewing the page source), but both of those operations are available in the browser’s menu bar. Other than making an image (which is still very obtainable), you can’t stop a user from obtaining information if you provide it via HTTP.