Yes, it's fine. Although we would probably drop the "written" -- "by" is enough to tell us that he's the author. I'm not a Shakespeare scholar, but he was a playwright, not a book author, so you may have a long search. Maybe: I'm going shopping to buy a book of Shakespeare's plays.
Then again, perhaps you're looking for a book on Shakespeare (where he is the subject).
Or perhaps it another Shakespeare entirely, one who is an author. I leave it to you.