【发布时间】:2015-05-30 01:52:16
【问题描述】:
嘿,所以我想要实现的是使用
获取页面上的所有链接preg_match_all("/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is"
然后在每个网址的末尾添加“|Cookie=”,同时保持页面来源完全相同。
例如:
假设我在抓取的页面“example.com/index.html 和 example2.com/index.html”中找到以下链接
我希望将它们更改为“example.com/index.html|Cookie=xxx”和“example2.com/index.html|Cookie=xxx”
如果我的问题太含糊,很抱歉。我不知道如何开始:(
【问题讨论】:
标签: php html regex string web-crawler