<%@ page import="java.util.List" %>
<%@ page import="org.jsoup.Jsoup" %>
<%@ page import="org.jsoup.nodes.Document" %>
<%@ page import="org.jsoup.nodes.Element" %>
<%@ page import="org.jsoup.select.Elements" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: 50px auto;
background-color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 10px;
}
input {
padding: 10px;
margin-bottom: 20px;
}
button {
background-color: #007bff;
color: #fff;
padding: 10px;
cursor: pointer;
}
#result {
margin-top: 20px;
font-size: 16px;
}
Keyword Research Tool
<%
String url = request.getParameter("url");
if (url != null && !url.isEmpty()) {
try {
Document document = Jsoup.connect(url).get();
Elements metaElements = document.select("meta[name=keywords]");
List keywords = new java.util.ArrayList<>();
for (Element element : metaElements) {
String content = element.attr("content");
if (!content.isEmpty()) {
String[] words = content.split(",");
for (String word : words) {
keywords.add(word.trim());
}
}
}
%>
Keywords found: <%= keywords %>
<%
} catch (IOException e) {
out.println("
Error fetching keywords: " + e.getMessage() + "
"); }
}
%>
0 Comments