Home | History | Annotate | Download | only in catapult_build
      1 # Copyright 2015 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 """Code for parsing HTML.
      6 
      7 The purpose of this module is to ensure consistency of HTML parsing
      8 in catapult_build.
      9 """
     10 
     11 import bs4
     12 
     13 
     14 def BeautifulSoup(contents):
     15   # html5lib is a lenient parser; compared with the default parser,
     16   # it is more similar to how a web browser parses. See:
     17   # http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser
     18   return bs4.BeautifulSoup(markup=contents, features='html5lib')
     19