我正在使用Goutte和Guzzle + Dom Crawler在Laravel中创建一个webscraper。我想抓取包含可变字符的网址。
我有http://www.example.com的基本网址。现在如果我去了post1页面,我希望刮刀有一个变量{$ post}并刮掉http://www.example.com/post1。但是,设置了example.com,以便post1在网址中包含随机的额外字符,例如http://www.example.com/21442/post1。
有没有办法在我的请求中添加正则表达式,以便我可以发出请求:http://www.example.com/ \ S * / {$ post}?