Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
spatie/crawler - How to get HTML of a javascript rendered website?

I am trying to use spatie/crawler to crawl a javascript rendered website for login.

$crawler = Crawler::create();
$browsershot = new Browsershot();
$browsershot->noSandbox();
$crawler->setBrowsershot($browsershot);
$crawler
->executeJavaScript()
->ignoreRobots()
->setCrawlObserver(new Observer())
->startCrawling($url);

After crawling, the $response->getBody()->getContents(), still return javascript.

<script src="https://www.google-analytics.com/analytics.js"></script><script type="text/javascript" src="/js/p2m.min.js?v=1634828250979.5806"></script>
    
    <animateTransform data-v-5ca127d8="" attributeType="xml" attributeName="transform" type="rotate" from="0 20 20" to=" ▶
    var p2mSubprogramCode = '';
    var programType = 'grsexternal';
    var cacheTtl = '3600';

How I can get the HTML? So that I can select the button for login.

<form id="loginform" reset="true">
...
<div class="form-group"><button id="btn-login" type="submit" class="btn btn-secondary">Sign In</button></div>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!