您可以使用以下代码生成一个网站的摘要: ```html
网站摘要生成器 <body> <script> var url = "https://www.example.com"; // 输入您要生成摘要的网站URL var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { var html = xhr.responseText; var parser = new DOMParser(); var doc = parser.parseFromString(html, "text/html"); var title = doc.title; var metaDescription = doc.querySelector('meta[name="description"]').getAttribute('content'); document.write("
网站标题: " + title + "
"); document.write("
网站摘要: " + metaDescription + "
"); } }; xhr.send(); </script>