Harmful online content can negatively influence users and create social risks. This study develops a machine learning model to detect harmful website content using Naïve Bayes, K-Nearest Neighbors (KNN), and Support Vector Machine (SVM). The analysis focuses on website text extracted from the HTML Document Object Model (DOM). Four classes were used: gambling, pornography, phishing, and whitelist content. The dataset consisted of 2911 URLs collected from the UT1 Blacklist repository. Text preprocessing and TF-IDF feature extraction with unigram and bigram representations produced 71,967 tokens. Experimental results show that SVM achieved the best performance with 90.50% accuracy on 2821 active URLs. A real-time Flask-based web application was also developed to classify URLs from user input. The findings demonstrate that combining NLP and machine learning provides an effective and practical solution for harmful website content detection.
Copyrights © 2026