跳转到主要内容

一个具有可插拔递归策略的简单网络蜘蛛

项目描述

Spydey

一个具有几个递归策略的简单网络蜘蛛。主页位于http://github.com/slinkp/spydey

它除了跟随链接和报告状态外,不做其他事情。我主要用它来进行快速且简陋的烟雾测试和链接检查。

唯一不寻常的功能是--traversal=pattern选项,它以不寻常的顺序进行递归遍历:它试图识别URL中的模式,并在跟随之前已看到的模式之前跟随新型模式的URL。如果没有新型模式可以跟随,它将跟随已知模式的随机链接。如果您将其用于测试将URL模式映射到视图/控制器的典型现代网络应用程序,这将非常快速地至少一次击中您的所有视图/控制器……通常。但是,当指向具有任意深度树(静态文件、VCS存储库等)的网站时,这并不很有趣。

此外,它被设计得非常容易添加新的递归策略。Spydey最初是为了实验不同的递归爬取策略而编写的。阅读源代码。

哦,如果您安装了Fabulous,控制台输出将带有颜色。

对于懒惰的零配置烟雾测试,我通常像这样运行

spydey -r --stop-on-error --max-requests=200 --traversal=pattern --profile --log-referrer URL

有许多其他命令行选项,其中许多是从wget窃取的。使用--help查看它们是什么。

用法

Usage: spydey [options] URL

Options:
  -h, --help            show this help message and exit
  -r, --recursive       Recur into subdirectories
  -p, --page-requisites
                        Get all images, etc. needed to display HTML page.
  --no-parent           Don't ascend to the parent directory.
  -R REJECT, --reject=REJECT
                        Regex for filenames to reject. May be given multiple
                        times.
  -A ACCEPT, --accept=ACCEPT
                        Regex for filenames to accept. May be given multiple
                        times.
  -t TRAVERSAL, --traversal=TRAVERSAL, --traverse=TRAVERSAL
                        Recursive traversal strategy. Choices are: breadth-
                        first, depth-first, hybrid, pattern, random
  -H, --span-hosts      Go to foreign hosts when recursive.
  -w WAIT, --wait=WAIT  Wait SECONDS between retrievals.
  --random-wait=RANDOM_WAIT
                        Wait from 0...2*WAIT secs between retrievals.
  --loglevel=LOGLEVEL   Log level.
  --log-referrer, --log-referer
                        Log referrer URL for each request.
  --transient-log       Use Fabulous transient logging config.
  --max-redirect=MAX_REDIRECT
                        Maximum number of redirections to follow for a
                        resource.
  --max-requests=MAX_REQUESTS
                        Maximum number of requests to make before exiting. (-1
                        used with --traversal=pattern means exit when out of
                        new patterns)
  --stop-on-error       Stop after the first HTTP error (response code 400 or
                        greater).
  -T TIMEOUT, --timeout=TIMEOUT
                        Set the network timeout in seconds. 0 means no
                        timeout.
  -P, --profile         Print the time to download each resource, and a
                        summary of the 20 slowest at the end.
  --stats               Print a summary of traversal patterns, if
                        --traversal=pattern
  -v, --version         Print version information and exit.

变更日志

0.5

  • 除非提供–stats,否则删除无用的模式统计信息

  • 修复,以防止在跟随重定向时跨越主机,除非开启-H。

0.4

  • 添加--stop-on-error选项

  • --max-requests=-1添加为停止所有模式都已被看到的情况(当与–traversal=pattern一起使用时)

  • 自动将使用说明添加到软件包信息

0.3

  • 改进重定向处理:遵循 -A、-R、–max-redirect 和 –max-requests 选项

  • 修复了少量错误并进行了重构

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

spydey-0.5.tar.gz (10.5 kB 查看哈希值)

上传时间

由以下机构支持