Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web scraping 用于抓取或抓取网站URL的软件_Web Scraping_Web Crawler - Fatal编程技术网

Web scraping 用于抓取或抓取网站URL的软件

Web scraping 用于抓取或抓取网站URL的软件,web-scraping,web-crawler,Web Scraping,Web Crawler,我想刮/爬(不知道哪一个是最好的翻译)的网站网址。例如,我希望从以下位置获取每个URL: www.Site.com/posts.html其中包含www.Site.com/2015-04-01/1 因此,我会输入软件www.Site.com,并将深度设置为2,以及所需的url文本www.Site.com/2015-04-01/1 所以。。软件应: 转到:www.Site.com/posts.html 查找匹配的URL:假设它查找: www.Site.com/2015-04-01/1/Workin

我想刮/爬(不知道哪一个是最好的翻译)的网站网址。例如,我希望从以下位置获取每个URL:
www.Site.com/posts.html
其中包含
www.Site.com/2015-04-01/1

因此,我会输入软件
www.Site.com
,并将深度设置为
2
,以及所需的url文本
www.Site.com/2015-04-01/1

所以。。软件应:

  • 转到:
    www.Site.com/posts.html

  • 查找匹配的URL:假设它查找:

    • www.Site.com/2015-04-01/1/Working Stuff.html
    • www.Site.com/2015-04-01/1/New stuff.html
    • www.Site.com/2015-04-01/1/News.html
  • 现在转到第一个匹配的url(a),并查找另一个包含
    www.Site.com/2015-04-01/1
    的url

    例如,它看起来是这样的:

    Main site: `www.Site.com/posts.html`
    
    
        1)www.Site.com/2015-04-01/1/Working-Stuff.html
            1a) www.Site.com/2015-04-01/1/Break.htm
            1b) www.Site.com/2015-04-01/1/How-to.htm
            1c) www.Site.com/2015-04-01/1/Lets-say.htm
            1d) www.Site.com/2015-04-01/1/Gamer-life.htm
    
        2) www.Site.com/2015-04-01/1/New-stuff.html
            2a) www.Site.com/2015-04-01/1/My-Story-about.htm
    
        3) www.Site.com/2015-04-01/1/News.html
            3a) www.Site.com/2015-04-01/1/Go-to-hell.htm
            3b) www.Site.com/2015-04-01/1/Leave.htm
    
    当然,我不需要前缀1)、2)、2a)等等。我只想获取URL

    我用过:


    A1网站刮刀-但当我试图从
    …html
    中刮刀时,它会剪切
    .html
    部分,并且不会给我完整的url列表:/

    [编辑了我之前的稍微简单化的答案]

    屏幕抓取是从网页中删除数据的过程。R套装rvest非常擅长刮屏

    网页爬行是指在一个网站中从一个页面移动到另一个页面的过程。R软件包rselenium非常擅长模仿用户在页面之间的移动,但只有当您了解网站的结构时


    你听起来像是想从一页爬到另一页,从首页开始,然后继续前进。我认为您可以使用和包的组合对其进行编码。在这两条路线之间,您可以定制并选择任何特定的未知路线。

    对不起,这是个糟糕的问题。请看以下内容: