使用Wget获取带有外部URL的列表

时间:2018-07-23 09:39:26

标签: web-crawler wget

我正在Windows {7}上运行wget,在Windows7上运行GOW,在Windows上运行的是GNU,是一种灵活的CygWin。

我想从上到下依次爬网一个域,而又不限制嵌套级别,并将所有外部url(先是其他域的地址,然后是已爬网的URL)保存到文本文件中。通过此操作,我想排除使用域名中包含facebook,google,pinterest和instagram的域。

我尝试以下方式:

$ wget https://example.com -O - 2>C:\tmp | grep -oP 'href="\Khttp:.+?"' | sed 's/"//' | grep -v facebook -v google -v pinterest -v instagram> file.txt

但是得到Access denied,没有其他任何警报。

是某处的写权限不足吗?还是其他?我该怎么办?

0 个答案:

没有答案