Parse an HTML document that contains a list of SubScene search results.

@param {string} html
@returns {Array<SearchResult>} the list of search results
323290
function parseSearchResults (html) {
  const $ = cheerio.load(html)
  return $('a')
    .filter(function (index, element) {
      const spans = $(element).find('span')
      return spans.length === 2 && spans.eq(0).text().trim() === 'English'
    })
    .map(function (index, element) {
      const title = $(element).find('span').eq(1).text().trim()
      const url = $(element).attr('href')
      return new SearchResult({
        title: title,
        url: url
      })
    })
    .get()
}
1159938
def parse_html(infile, xpath):
    """"""
    if not isinstance(infile, lh.HtmlElement):
        infile = lh.fromstring(infile)
    infile = infile.xpath(xpath)
    if not infile:
        raise ValueError('XPath {0} returned no results.'.format(xpath))
    return infile
922232
def parse_html(self, text):
        
        bs = BeautifulSoup(text, "html5lib")
        file_reg = re.compile(MARKDOWN_IMAGE_REGEX, flags=re.IGNORECASE)
        tags = bs.findAll('img')

        for tag in tags:
            # Look for src attribute, remove formatting if added to image
            src_text = tag.get("src") or ""
            formatted_src_match = file_reg.search(src_text)
            src_text = formatted_src_match.group(2) if formatted_src_match else src_text

            alt_text = tag.get("alt") or ""
            tag.replaceWith("![{alt}]({src})".format(alt=alt_text, src=src_text))
        return html.unescape(bs.find('body').renderContents().decode('utf-8'))
850634
def parse_html(html: str, parser: FragmentParser = None) -> Node:
    
    parser = parser or FragmentParser()
    parser.feed(html)
    return parser.root
321487
def parse_html(user_id)
      url = API_URL + user_id
      first_doc = JSON.parse(open(url).read)
      totalsize = first_doc['totalsize']

      url = API_URL + user_id + '&startNum=0&endNum=' + totalsize.to_s
      @doc = JSON.parse(open(url).read)['result1']
    end
1249585
def __parse(self, string=''):
        '''
        
        '''
        self.string = string
        self.string = self.wiki_re.sub('', self.string)
        # search for lists
        self.listmatch = re.search('^(\*+)', self.string)
        if self.listmatch:
            self.string = self.__list(self.listmatch) + re.sub('^(\*+)', \
                          '', self.string)
        return self.string
521603
function innerText(html) {
      var schema = new Schema(), domParser = new DomParser({}, schema), text = '';
      var shortEndedElements = schema.getShortEndedElements();
      var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' ');
      var blockElements = schema.getBlockElements();

      function walk(node) {
        var name = node.name, currentNode = node;

        if (name === 'br') {
          text += '\n';
          return;
        }

        // img/input/hr
        if (shortEndedElements[name]) {
          text += ' ';
        }

        // Ingore script, video contents
        if (ignoreElements[name]) {
          text += ' ';
          return;
        }

        if (node.type == 3) {
          text += node.value;
        }

        // Walk all children
        if (!node.shortEnded) {
          if ((node = node.firstChild)) {
            do {
              walk(node);
            } while ((node = node.next));
          }
        }

        // Add \n or \n\n for blocks or P
        if (blockElements[name] && currentNode.next) {
          text += '\n';

          if (name == 'p') {
            text += '\n';
          }
        }
      }

      html = filter(html, [
        /<!\[[^\]]+\]>/g // Conditional comments
      ]);

      walk(domParser.parse(html));

      return text;
    }
567597
def parse(self, text, html=True):
        ''''''
        self._urls = []
        self._users = []
        self._lists = []
        self._tags = []

        reply = REPLY_REGEX.match(text)
        reply = reply.groups(0)[0] if reply is not None else None

        parsed_html = self._html(text) if html else self._text(text)
        return ParseResult(self._urls, self._users, reply,
                           self._lists, self._tags, parsed_html)
785371
function getHtmls (urls) {
  return Promise.all(urls.map(url => got(url).then(res => res.body)))
}
502629
public function parse($html)
    {
        if (!is_array($html)) {
            if (file_exists($html)) {
                $html = file($html);
            } else {
                return "Error opening template file $html";
            }
        }
        $return = '';
        foreach ($html as $line) {
            $return .= preg_replace_callback('/\<dynamic\s+name\s*=\s*[\'"](\S+?)[\'"]\>/i', [&$this, 'replace'], $line);
        }

        return $return;
    }
95292
function html(template) {
    var expressions = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        expressions[_i - 1] = arguments[_i];
    }
    var result = "";
    var i = 0;
    // resolve each expression and build the result string
    for (var _a = 0, template_1 = template; _a < template_1.length; _a++) {
        var part = template_1[_a];
        var expression = expressions[i++ - 1]; // this might be an array
        var resolvedExpression = resolveExpression(expression);
        result += "" + resolvedExpression + part;
    }
    // strip indentation and trim the result
    return strip_indent_1.default(result).trim();
}
84992
function processHtml(demo) {

      var allContent = demo.files.index.contents;

      var processors = [
        applyAngularAttributesToParentElement,
        insertTemplatesAsScriptTags,
        htmlEscapeAmpersand
      ];

      processors.forEach(function(processor) {
        allContent = processor(allContent, demo);
      });

      return allContent;
    }
1022212
function(htmlString) {
        var matchResult;
        htmlString = htmlString.replace(/[\n\r\t]/g, '');
        if (snippet.hasEncodableString(htmlString)) {
            if (/<img/i.test(htmlString)) {
                matchResult = htmlString.match(/<img[^>]*\ssrc=["']?([^>"']+)["']?[^>]*>/i);
                htmlString = matchResult ? matchResult[1] : '';
            } else {
                htmlString = htmlString.replace(/<button.*?<\/button>/gi, '');
            }
            htmlString = $.trim(snippet.decodeHTMLEntity(
                htmlString.replace(/<\/?(?:h[1-5]|[a-z]+(?::[a-z]+)?)[^>]*>/ig, '')
            ));
        }

        return htmlString;
    }
672294
function processHTML(cssSelectors = [], htmlDataIn = null, htmlOptionsIn = null) {

		//read html files
		if (OPTIONS.html !== '' && OPTIONS.html !== undefined && OPTIONS.special_reduce_with_html) {

			var htmlFiles = OPTIONS.html;
			tmpHTMLPaths = [];

			//check for file or files
			switch (typeof htmlFiles) {
				case 'object':
				case 'array':
						
					for (i = 0; i < htmlFiles.length; ++i) {

						getFilePaths(htmlFiles[i], ['.html','.htm']);
					}

					if (tmpHTMLPaths.length) {
						htmlFiles = tmpHTMLPaths;
					}
					break;
				case 'string':
					//formats
					htmlFiles = htmlFiles.replace(/ /g, '');

					// comma delimited list - filename1.html, filename2.html
					if (htmlFiles.indexOf(',') > -1) { 
			
						htmlFiles = htmlFiles.replace(/^\s+|\s+$/g,'').split(',');
						tmpStr = '';
						for (i = 0; i < htmlFiles.length; ++i) {

							getFilePaths(htmlFiles[i], ['.html','.htm']);

						} //end of for

						if (tmpHTMLPaths.length) {
							htmlFiles = tmpHTMLPaths;
						}

					} else {

						//string path
						getFilePaths(htmlFiles, ['.html','.htm']);

						if (tmpHTMLPaths.length) {
							htmlFiles = tmpHTMLPaths;
						}

					}

					break;
			} //end of switch

			htmlFileLocation = (htmlFiles)?htmlFiles.toString():htmlFiles;

			readHTMLFile(htmlFiles);
			CPEVENTS.on('HTML_READ_AGAIN', function(){
				//process selectors
				processHTMLSelectors(cssSelectors, htmlDataIn, htmlOptionsIn);

				//read next file
				dataHTMLIn = [];
				readHTMLFile(htmlFiles);
			});
			CPEVENTS.on('HTML_READ_END', function(){
				//process selectors
				processHTMLSelectors(cssSelectors, htmlDataIn, htmlOptionsIn);

				dataHTMLIn = [];
				CPEVENTS.emit('HTML_RESULTS_END', cssSelectors);

			});


		} //end of html files check








	}
324149
public final Element parse(final String html) {
        checkNotNull(html, "Received a null pointer as body");

        return Jsoup.parse(html).body();
    }
725558
function parseHTML(html) {
	var temp = [];

	function push(code, type, padding) {
		code = code.replace(/\n/g, '');
		if (padding) {
			temp.push({code: code, type: type, padding: padding});
		} else {
			temp.push({code: code, type: type});
		}
	}

	function dig(nodes) {
		for (var i = 0; i < nodes.length; i ++) {
			var node = nodes[i];
			switch (node.type) {
				case 'comment':
				break;

				case 'text':
				var words = trim(node.raw).split(' ');
				for (var j = 0, jj = words.length; j < jj; j++) {
					push(words[j] + (j + 1 == jj ? '' : ' '), 'text');
				}
				break;

				case 'directive':
				push('<' + node.raw + '>', 'tag');
				break;

				default:
				var tag = node.name;
				var attribs = node.attribs || {};

				push('<' + tag, 'tag', paddingHTML);
				for (var key in attribs) {
					push(' ' + key + '="' + attribs[key] + '"', 'tag', paddingHTML);
				}
				push('>', 'tag');

				switch (tag) {
					case 'br':
					case 'input':
					case 'hr':
					case 'link':
					case 'meta':
					case 'img':
					case 'embed':
					case 'param':
					case 'area':
					case 'base':
					case 'col':
					case 'keygen':
					case 'source':
					continue;

					case 'script':
					if ((!attribs.type || attribs.type == 'text/javascript') && node.children && node.children[0]) {
						temp = temp.concat(parseJS(node.children[0].raw));
					}
					break;

					case 'style':
					if ((!attribs.type || attribs.type == 'text/css') && node.children && node.children[0]) {
						temp = temp.concat(parseCSS(node.children[0].raw));
					}
					break;

					default:
					if (node.children) dig(node.children);
				}

				push('</' + tag + '>', 'tag')
			}
		}
	}

	var handler = new htmlparser.DefaultHandler(function (error, dom) {});
	new htmlparser.Parser(handler).parseComplete(html);
	dig(handler.dom);

	var nodes = [];
	for (var i = 0, j = 0, ii = temp.length, lastType; i < ii; i++) {
		var tmp = temp[i];
		if (i && (lastType == tmp.type || !tmp.type)) {
			nodes[++j] = tmp;
		} else {
			if (!nodes[j]) {
				nodes[j] = tmp;
			} else {
				nodes[j].code += tmp.code;
				nodes[j].padding = tmp.padding;
			}
		}
		lastType = tmp.type;
	}
	return nodes;
}
1326513
function parse(elementOrHtml, config) {
    wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();

    var context       = config.context || elementOrHtml.ownerDocument || document,
        fragment      = context.createDocumentFragment(),
        isString      = typeof(elementOrHtml) === "string",
        clearInternals = false,
        element,
        newNode,
        firstChild;

    if (config.clearInternals === true) {
      clearInternals = true;
    }

    if (isString) {
      element = wysihtml5.dom.getAsDom(elementOrHtml, context);
    } else {
      element = elementOrHtml;
    }

    if (currentRules.selectors) {
      _applySelectorRules(element, currentRules.selectors);
    }

    while (element.firstChild) {
      firstChild = element.firstChild;
      newNode = _convert(firstChild, config.cleanUp, clearInternals, config.uneditableClass);
      if (newNode) {
        fragment.appendChild(newNode);
      }
      if (firstChild !== newNode) {
        element.removeChild(firstChild);
      }
    }

    if (config.unjoinNbsps) {
      // replace joined non-breakable spaces with unjoined
      var txtnodes = wysihtml5.dom.getTextNodes(fragment);
      for (var n = txtnodes.length; n--;) {
        txtnodes[n].nodeValue = txtnodes[n].nodeValue.replace(/([\S\u00A0])\u00A0/gi, "$1 ");
      }
    }

    // Clear element contents
    element.innerHTML = "";

    // Insert new DOM tree
    element.appendChild(fragment);

    return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;
  }