python seo analyzer
2024.04.21
一个SEO工具分析站点的结构,爬网,计数站点主体中的单词,并警告任何技术SEO问题。
需要Python 3.6+,BeautifulSoup4和Urllib3。
pip3 install pyseoanalyzer
docker run sethblack/python-seo-analyzer [ARGS ...]
如果您没有站点地图,它将开始在主页上爬行。
seoanalyze http://www.domain.com/或者,您可以指定SitMap的路径,以将URL播种为扫描列表。
seoanalyze http://www.domain.com/ --sitemap path/to/sitemap.xml可以从分析而不是JSON生成HTML输出。
seoanalyze http://www.domain.com/ --output-format html analyze函数返回词典,并带有爬网的结果。
from pyseoanalyzer import analyze
output = analyze ( site , sitemap )
print ( output )为了分析标题标签(H1-H6)和其他额外其他标签,可以将以下选项传递给analyze功能
from pyseoanalyzer import analyze
output = analyze ( site , sitemap , analyze_headings = True , analyze_extra_tags = True )
print ( output )默认情况下, analyze功能也分析了所有现有的内部链接,这可能很耗时。可以通过将以下选项传递给analyze函数来更改此默认行为以仅分析提供的URL
from pyseoanalyzer import analyze
output = analyze ( site , sitemap , follow_links = False )
print ( output )另外,您可以从SeoAnalyzer文件夹中运行分析。
python -m seoanalyzer https://www.sethserver.com/ -f html > results.html如果您在命令行或通过python-api中获取requests.exceptions.SSLError ,请尝试使用:
而不是..