Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wpull/document/css.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class CSSReader(BaseDocumentDetector, BaseTextStreamReader):
'''Cascading Stylesheet Document Reader.'''
URL_PATTERN = r'''url\(\s*(['"]?)(.{1,500}?)(?:\1)\s*\)'''
URL_PATTERN = r'''url\(\s*(['"]?)(.*?)(?:\1)\s*\)'''
IMPORT_URL_PATTERN = r'''@import\s*(?:url\()?['"]?([^\s'")]{1,500}).*?;'''
URL_REGEX = re.compile(r'{}|{}'.format(URL_PATTERN, IMPORT_URL_PATTERN))
BUFFER_SIZE = 1048576
Expand Down
1 change: 1 addition & 0 deletions wpull/scraper/html_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def test_html_scraper_links(self):
'http://example.com/style_import_quote_url.css',
'http://example.com/style_single_quote_import.css',
'http://example.com/style_double_quote_import.css',
'http://example.com/bg.png',
'http://example.com/link_href.css',
'http://example.com/script.js',
'http://example.com/body_background.png',
Expand Down
3 changes: 3 additions & 0 deletions wpull/testing/samples/many_urls.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
@import 'style_single_quote_import.css';
@import "style_double_quote_import.css";
</style>
<style>
#emb{background-image:url();width:144px;height:144px}#nav{background-image:url("bg.png")}#foo{background-image:url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin" width="100%" height="100%"><rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" /></svg>');width:200px;height:200px}
</style>
<script type="text/javascript" src="script.js"></script>
<link rel="stylesheet" href="link_href.css">
<meta property="og:image" content="og_image.png">
Expand Down