0

I was scraping a website using the Guzzle library for extracting specific data from HTML. But now, the website doesn't visualize content until the browser has JavaScript enabled.

So now I'm stuck with these questions:

  1. Can guzzle client emulate that javascript is enabled?
  2. Are there any other tools in the PHP language (besides Guzzle) that could help with this problem?

Any advice is welcome.

Dzhuneyt
  • 8,437
  • 14
  • 64
  • 118
EdvinasPocius
  • 173
  • 2
  • 10
  • no, you need an external tool like `phantomjs`, site doesn't know if you have javascript on until your browser starts to interpret it – Flash Thunder Nov 23 '19 at 09:41
  • Guzzle can't execute the JavaScript, but you could use your browser's tools to find the API calls the JS makes and emulate those. – ceejayoz Nov 23 '19 at 16:25

1 Answers1

1

You can use selenium to automates browsers.

Refer to How to use Selenium with PHP? to use it in php.

You can also refer to Selenium PHP Tutorial

LF00
  • 27,015
  • 29
  • 156
  • 295