[ // put any GuzzleHttp options here ] ]; try { $parser = new SitemapParser('MyCustomUserAgent', $config); $parser->parse('https://www.google.com/robots.txt'); foreach ($parser->getSitemaps() as $url => $tags) { echo 'Sitemap
'; echo 'URL: ' . $url . '
'; echo 'LastMod: ' . $tags['lastmod'] . '
'; echo '
'; } foreach ($parser->getURLs() as $url => $tags) { echo 'URL: ' . $url . '
'; echo 'LastMod: ' . $tags['lastmod'] . '
'; echo 'ChangeFreq: ' . $tags['changefreq'] . '
'; echo 'Priority: ' . $tags['priority'] . '
'; echo '
'; } } catch (SitemapParserException $e) { echo $e->getMessage(); }