FriendsOfPHP / Goutte

Goutte, a simple PHP Web Scraper
MIT License
9.26k stars 1.01k forks source link

wordpress multisite returns html of 'original' site #348

Open iateadonut opened 6 years ago

iateadonut commented 6 years ago

If I try to set a url to the 'extra' site on a Wordpress multisite installation, this returns the html of the original site.

try {
    $crawler = $scraper->request('GET', $url);
} catch( Exception $e ) {

}

// redirect if necessary
while ( $scraper->getResponse() instanceof RedirectResponse ) {
    $crawler = $scraper->followRedirect();
}

echo $crawler->html();