public function getEndPoint()
    {
        $html = $this->response->getHtmlContent();

        if ($html && ($url = self::getEndPointFromDom($html))) {
            try {
                $endPoint = $this->response->getUrl()->createAbsolute($url);
            } catch (Exception $exception) {
                return null;
            }

            if ($endPoint->getExtension() !== 'xml' && !$endPoint->hasQueryParameter('format')) {
                return $endPoint->withQueryParameter('format', 'json');
            }

            return $endPoint;
        }
    }