code: public static synchronized Document getEventDocFromUrl(String url) throws TvDbException {
          Document doc = null;
  
          String webPage = getValidWebpage(url);
          
          // If the webpage returned is null or empty, quit
          if(StringUtils.isBlank(webPage)){
              return null;
          }
          
          try (InputStream in = new ByteArrayInputStream(webPage.getBytes(CHARSET))) {
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              DocumentBuilder db = dbf.newDocumentBuilder();
              doc = db.parse(in);
              doc.getDocumentElement().normalize();
          } catch (UnsupportedEncodingException ex) {
              throw new TvDbException(ApiExceptionType.INVALID_URL, "Unable to encode URL", url, ex);
          } catch (ParserConfigurationException | SAXException | IOException error) {
              throw new TvDbException(ApiExceptionType.MAPPING_FAILED, ERROR_UNABLE_TO_PARSE, url, error);
          }
  
          return doc;
      }
docs: Get a DOM document from the supplied URL
  
  @param url
  @return
  @throws com.omertron.thetvdbapi.TvDbException