• 请不要在回答技术问题时复制粘贴 AI 生成的内容
jasamboro
V2EX  ›  程序员

PHP 监控网页内容更新并下载的问题

  •  
  •   jasamboro · May 13, 2020 · 2426 views
    This topic created in 2231 days ago, the information mentioned may be changed or developed.

    我通过 php 获取到网页上的所有链接之后,想筛选出链接地址中含有当日日期的链接要怎么做

    https://www.v2ex.com/ https://www.v2ex.com/2020-05-13/xxxxx.pdf

    例如这样,我想筛出包含了 2020-05-13 的这条链接并下载到本地

    4 replies    2020-05-14 18:46:16 +08:00
    hoythan
        1
    hoythan  
       May 13, 2020
    正则
    tankren
        2
    tankren  
       May 13, 2020
    preg_match
    liuxu
        3
    liuxu  
       May 13, 2020
    小伙子写爬虫说的这么委婉,xpath 比正则好用
    jasamboro
        4
    jasamboro  
    OP
       May 14, 2020 via iPhone
    @liuxu 哈哈,其实就是每天半夜来一趟增量下载
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5857 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 80ms · UTC 03:33 · PVG 11:33 · LAX 20:33 · JFK 23:33
    ♥ Do have faith in what you're doing.