public function save_driver_content(\Openbuildings\Spiderling\Driver $driver, $filename, $title)
    {
        $content = $driver->content();

        foreach (['href', 'action', 'src'] as $attribute) {
            $content = self::to_absolute_attribute($attribute, $content, $this->_base_url);
        }

        $testview = self::render_file(__DIR__.'/../assets/error-page.php', [
            'url' => $driver->current_url(),
            'title' => $title,
            'javascript_errors' => $driver->javascript_errors(),
            'javascript_messages' => $driver->javascript_messages(),
        ]);

        $page_content = str_replace('</body>', $testview.'</body>', $content);

        file_put_contents($this->_directory."/$filename.html", $page_content);

        try {
            $driver->screenshot($this->_directory."/$filename.png");
        } catch (\Openbuildings\Spiderling\Exception_Notimplemented $e) {
            // Ignore not generating the screenshot if the driver doesn't support it
        }
    }