hocam bu python kodu ile siteui taratip sınırsız sitemap oluşturabilirsiniz
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin, urlparse
def get_all_links(url):
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
links = set()
# Sayfadaki tüm <a> tag'lerini bul
for a_tag in soup.find_all('a', href=True):
href = a_tag['href']
full_url = urljoin(url, href)
# Aynı domain içinde kalmak için kontrol
if urlparse(full_url).netloc == urlparse(url).netloc:
links.add(full_url)
return links
def generate_sitemap(links, output_file='sitemap.xml'):
with open(output_file, 'w') as f:
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
f.write('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n')
for link in links:
f.write(' <url>\n')
f.write(f' <loc>{link}</loc>\n')
f.write(' </url>\n')
f.write('</urlset>')
if __name__ == "__main__":
# Başlangıç URL'si
url = "https://www.ornekdomain.com"
# Tüm bağlantıları al
links = get_all_links(url)
# Sitemap dosyasını oluştur
generate_sitemap(links)
print(f"Sitemap oluşturuldu: {len(links)} link bulundu.")