Skip to content

JSONDecodeError: Extra data: line 21 column 1 (char 572) for URL https://lubelska.co.uk/ #143

Description

@advance512

Seems that the issue is that the JSON-LD document is:

// <![CDATA[
{
  "@context": "http:\/\/schema.org\/",
  "name": "Lubelska",
  "@type": "Organization",
  "logo": "https://lubelska.co.uk/wp/wp-content/uploads/2019/05/Lubelska-1.jpg",
  "url": "https://lubelska.co.uk/",
  "sameAs": [
    "https://twitter.com/EdwardHowey",
    "https://www.facebook.com/Lubelska-309144763268698/",
    "https://www.pinterest.co.uk/lubelskaltd/",
    "https://www.instagram.com/lubelska1/"
  ],
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+44 20 3911 5526",
    "email": "info@lubelska.co.uk",
    "contactType": "sales"
  }]
}
// ]]&gt;

and after the replacing in jsonLd._extractItems():

            # sometimes JSON-decoding errors are due to leading HTML or JavaScript comments
            data = json.loads(
                HTML_OR_JS_COMMENTLINE.sub('', script), strict=False)

it becomes:

{
  "@context": "http:\/\/schema.org\/",
  "name": "Lubelska",
  "@type": "Organization",
  "logo": "https://lubelska.co.uk/wp/wp-content/uploads/2019/05/Lubelska-1.jpg",
  "url": "https://lubelska.co.uk/",
  "sameAs": [
    "https://twitter.com/EdwardHowey",
    "https://www.facebook.com/Lubelska-309144763268698/",
    "https://www.pinterest.co.uk/lubelskaltd/",
    "https://www.instagram.com/lubelska1/"
  ],
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+44 20 3911 5526",
    "email": "info@lubelska.co.uk",
    "contactType": "sales"
  }]
}
// ]]&gt;

and naturally this part which was not replaced:

// ]]&gt;

causes the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions