【问题标题】:Downloading all pdf files from google scholar search results using wget使用 wget 从谷歌学者搜索结果中下载所有 pdf 文件
【发布时间】:2012-08-29 15:28:17
【问题描述】:

我想写一个简单的网络蜘蛛或者只是使用wget 从谷歌学者那里下载 pdf 结果。这实际上是一种获得研究论文的好方法。

我已阅读 stackoverflow 上的以下页面:

Crawl website using wget and limit total number of crawled links

How do web spiders differ from Wget's spider?

Downloading all PDF files from a website

How to download all files (but not HTML) from a website using wget?

最后一页可能是最鼓舞人心的。我确实按照this 的建议尝试使用wget

我的谷歌学者搜索结果页面是thus,但没有下载任何内容。

鉴于我对 webspider 的了解程度很低,我应该怎么做才能做到这一点?我确实意识到编写蜘蛛可能非常复杂,并且是我可能不想承担的项目。如果可以使用wget,那就太棒了。

【问题讨论】:

    标签: unix wget web-crawler


    【解决方案1】:
    wget -e robots=off -H --user-agent="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3" -r -l 1 -nd -A pdf http://scholar.google.com/scholar?q=filetype%3Apdf+liquid+films&btnG=&hl=en&as_sdt=0%2C23
    

    需要注意的几点:

    1. 在搜索查询中使用 filetyle:pdf
    2. 一级递归
    3. -只接受pdf的pdf
    4. -H 跨主机
    5. -e robots=off 并使用 --user-agent 将确保获得最佳结果。 Google Scholar 拒绝空白用户代理,并且 pdf 存储库可能不允许使用机器人。

    当然,限制是这只会打到结果的第一页。您可以扩展递归的深度,但这会很疯狂并且会永远持续下去。我建议使用 Beautiful Soup 和 wget 子流程之类的组合,这样您就可以有策略地解析和遍历搜索结果。

    【讨论】:

    • 不,不幸的是,当我运行此命令时,我的终端窗口崩溃并关闭。我没有运行 Mozilla 5.0……它是 firefox 15……所以我应该相应地进行一些更改吗?我将firefox 3.0.3 更改为firefox 15 但无济于事。
    • 可能是续行 ()。编辑删除它们 - 再试一次。用户代理可以是任何你喜欢的......
    • 我收到ERROR 503: Service Unavailable.
    猜你喜欢
    • 2011-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-21
    • 2016-09-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多