1
0
Fork 0

[extractor] Improve json+ld extraction

Related #5035
This commit is contained in:
pukkandan 2022-09-27 02:30:50 +05:30
commit 0f60ba6e65
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
3 changed files with 11 additions and 4 deletions

View file

@ -232,7 +232,7 @@ DATE_FORMATS_MONTH_FIRST.extend([
])
PACKED_CODES_RE = r"}\('(.+)',(\d+),(\d+),'([^']+)'\.split\('\|'\)"
JSON_LD_RE = r'(?is)<script[^>]+type=(["\']?)application/ld\+json\1[^>]*>\s*(?P<json_ld>{.+?})\s*</script>'
JSON_LD_RE = r'(?is)<script[^>]+type=(["\']?)application/ld\+json\1[^>]*>\s*(?P<json_ld>{.+?}|\[.+?\])\s*</script>'
NUMBER_RE = r'\d+(?:\.\d+)?'