我正在创建一个将URL传递并获取页面内容的函数。如果此页面包含“下一步>”,我想抓取该网址并继续进入下一页下的页面,该页面不再包含下一页。需要帮助了解如何循环功能
这将如何完成?一个while循环?
check_url("http://site.com");
-> url contains 'next', href is http://site.com/ggkdoe
-> does http://site.com/ggkdoe contain next? if so, hit it again and check if that contains 'next' then get that url etc etc
明白吗?如何才能做到这一点?
预先感谢您
到目前为止尝试过什么? – 2012-02-28 09:00:09
通常,“下一步”按钮由服务器端生成,不解析客户端输出。 – Raptor 2012-02-28 09:00:57
[强大的,成熟的HTML解析器的PHP]的可能重复(http://stackoverflow.com/questions/292926/robust-mature-html-parser-for-php) – CodeCaster 2012-02-28 09:01:00