Make a JavaScript-aware Crawler

前端 未结 2 1434
春和景丽
春和景丽 2020-12-10 09:14

I want to make a script that\'s crawling a website and it should return the locations of all the banners showed on that page.

The locations of banners are most of th

2条回答
  •  既然无缘
    2020-12-10 10:08

    You could use selenium to open the pages in a real browser and then access the DOM.

    PhantomJS might also be worth a look - it's a headless version of WebKit (the engine behind Chrome, Safari, etc.).

    However, none of those solutions are pure php - if that's a requirement, you'll probably have to write your own JavaScript engine in PHP (which is nothing I'd ask my worst enemy to do ;))

提交回复
热议问题