Home > Mobile >  PHP scrape website that uses JS to put content AFTER
PHP scrape website that uses JS to put content AFTER

Time:10-05

I want to scrape the following website for price https://www.falabella.com/falabella-cl/product/15489111/Bicicleta-Titanium-700C-Verde/15489114 Usually that could be done by using PHP file_get_contents() and finding and html element and selecting innet text, but it appears this website in particular uses JS to generate HTML after. What can be done? thanks.

CodePudding user response:

In general, there is no option to scrape JS websites using PHP, but you can use libraries for testing. For example https://github.com/symfony/panther

CodePudding user response:

Not using PHP to scrape it. You need a framework with embedded browser like https://phantomjs.org/.

You actually need to run the JS that's on the page. There's no other way.

  • Related