Exemplo n.º 1
0
    def test_scripts(self):
        content = """
    <html>
    <body>
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
      <script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js">
    </body>
    </html>"""

        doc_features = list(features.scripts(doc(content)))
        eq_(doc_features, [('scripts', [
            u'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
            u'http://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js'
        ])])
Exemplo n.º 2
0
  def test_scripts(self):
    content =  """
    <html>
    <body>
      <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
      <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js">
    </body>
    </html>"""
    doc = bs4.BeautifulSoup(content)
 
    doc_features =  list(features.scripts(doc))
    eq_(
      doc_features,
      [('script', u'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'), 
      ('script', u'//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js')]
    )
Exemplo n.º 3
0
  def test_scripts(self):
    content =  """
    <html>
    <body>
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
      <script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js">
    </body>
    </html>"""

    doc_features =  list(features.scripts(doc(content)))
    eq_(
      doc_features,
      [
        (
          'scripts', 
          [
            u'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', 
            u'http://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js'
          ]
        )
      ]
    )