As long as these books are beneficial and help you seek knowledge and get closer to Allah, then this would not be wasteful. There is nothing more important than spending on seeking knowledge. Go ahead and buy them and increase your knowledge and Allah will reward you, and whenever you get the opportunity, donate to charities as well.