使 $dom = $html->load(file_get_contents($nextLink)) 等待网站加载

Make $dom = $html->load(file_get_contents($nextLink)) wait for website to load

我有一个 HTML 简单的 DOM 解析器程序...

我的问题是:

我正在尝试获取不同页面上的产品链接。

第一页的链接,收藏没问题。

当我尝试访问第二页时,大问题来了。有启动产品的事件,不改url,根据页面添加#/page-2 ... 3 ... 4

问题是程序无法走到第二页。它总是在第一个,重复这个链接。

有办法让程序跳到第二页吗?

这是我使用的代码:

我放了例子 url,但我使用 $nextLink 循环访问页面。

谢谢^^

    $html = new simple_html_dom();
    $dom = $html->load(file_get_contents(http://www.perfumeriasabina.com/es/29-perfumeria-sabina-online#/page-2));
        if (!empty($dom))
        {
            $dom->find('a');
        }   
     $productos = $html->find('.product_img_link');
     foreach($productos as $producto) 
     {
       $enlaces = $producto->href; 
       echo $enlaces . "<br/>";
     }

对该网站进行了少量研究,只需附加:

?p=2

到url,根据你要下载的页码,所以你的URL会是这样的:

http://www.perfumeriasabina.com/es/29-perfumeria-sabina-online?p=2