Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

BaseSgmlLinkExtractor: Added unit test of a link with an inner tag

Benoit Blanchon79179f59b24d
diff --git a/scrapy/tests/sample_data/link_extractor/sgml_linkextractor.html b/scrapy/tests/sample_data/link_extractor/sgml_linkextractor.html
index fecd86563..35aa457ee 100644
--- a/scrapy/tests/sample_data/link_extractor/sgml_linkextractor.html
+++ b/scrapy/tests/sample_data/link_extractor/sgml_linkextractor.html
@@ -12,6 +12,7 @@
<a href='http://example.com/sample3.html' title='sample 3'>sample 3 text</a>
<a href='sample3.html'>sample 3 repetition</a>
<a href='http://www.google.com/something'></a>
+<a href='http://example.com/innertag.html'><b>inner</b> tag</a>
</div>
</body>
</html>
diff --git a/scrapy/tests/test_contrib_linkextractors.py b/scrapy/tests/test_contrib_linkextractors.py
index 1bd129a03..564ade324 100644
--- a/scrapy/tests/test_contrib_linkextractors.py
+++ b/scrapy/tests/test_contrib_linkextractors.py
@@ -121,6 +121,7 @@ class SgmlLinkExtractorTestCase(unittest.TestCase):
Link(url='http://example.com/sample2.html', text=u'sample 2'),
Link(url='http://example.com/sample3.html', text=u'sample 3 text'),
Link(url='http://www.google.com/something', text=u''),
+ Link(url='http://example.com/innertag.html', text=u'inner tag'),
])
lx = SgmlLinkExtractor(allow=('sample', ))