Films have certification, CDs come with advisory notices but the novel, or other book for that matter, has no warnings at all about the content inside those covers.
I recently bought some end of life books from the library. So far there are three of them with language that I don’t want to see, read or hear and so they shall go to the rubbish tip where they belong. Had I bought them from a shop as new I would have returned them and demanded my money refunded. There should be a warning on them so that the buyer can decide for themselves if the book is suitable or not.