web-scraping - wget下载nofollow链接
问题描述
我想用 wget 抓取/抓取一个 wordpress 网站。
问题:wget 将下载文档/链接,尽管它们具有rel=nofollow
属性。是的,我确实允许 robots.txt。
例子:
wget --mirror --page-requisites --adjust-extension --convert-links --restrict-file-names=windows --no-parent --span-hosts --domains=randomascii.wordpress.com,wp.com https://randomascii.wordpress.com/about/
现在打开about
文件夹,几秒钟后,您将看到数十个来自 nofollow 链接的 html 文件:index.html@share=reddit.html
, index.html@share=twitter.html
, index.html@replytocom=74214.html
...
GNU Wget 1.20.3 built on msys.
-cares +digest +gpgme +https +ipv6 +iri +large-file +metalink +nls
+ntlm +opie +psl +ssl/openssl
Wgetrc:
/etc/wgetrc (system)
Locale:
/usr/share/locale
Compile:
gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
-DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib -DHAVE_LIBSSL
-DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe
Link:
gcc -DHAVE_LIBSSL -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe
-pipe -lmetalink -lexpat -lpcre2-8 -luuid -lssl -lcrypto -lz -lz
-lpsl -lidn2 -liconv -lunistring -lgpgme -lassuan -lgpg-error
ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a -liconv -lintl
/usr/lib/libunistring.dll.a
解决方案
推荐阅读
- firebase - 带有云 sql 的 Firebase 函数
- laravel - 将编辑器连接到 Laravel
- laravel - 使用 2 种不同的背景样式运行 foreach
- r - Gibbs 区域交互模型的 effectfun 和 parres 错误
- python - 如何将嵌套 for 循环的迭代次数限制为仅循环计数器不同的情况?
- python-3.x - 尝试使用用户输入将列表另存为文件,但不断收到一条显示“无”的额外行
- python - 我该如何解决“ascii 编解码器无法解码位置 8 中的字节 0x9a:序数不在范围内(128)”?(python 3 中 cPickle 的问题)
- c - 按值或指针传递和返回结构 - 是否有默认准则?
- outlook - 如何使用预填充的收件人和主题字段创建指向 Outlook 的链接?
- javascript - iPhone Mobile Safari 在从横向旋转到纵向后强制出现顶部栏(避免“最小 ui”)