can't parse a (probably) valid json object









up vote
2
down vote

favorite












I am trying to parse a json object whith following code in python 3.



import json
str = '"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'
c = json.loads(str)
print(c['id'])


when I execute the script, I got an error:



json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 270 (char 269)


I have parsed many json objects with this code and can't understand what is wrong with it now, or what is wrong with this particular json object.



Regards.










share|improve this question



















  • 1




    One way to debug this is the load it into a json pretty printer and see if its able to parse or locate the error its pointing to
    – ritlew
    Nov 9 at 19:50










  • @ritlew I tried it and it's completely valid there.
    – Ali Crash
    Nov 9 at 19:55






  • 2




    Well, what is line 1 column 270 (char 269)?
    – cricket_007
    Nov 9 at 19:58






  • 1




    It is near a backslash.
    – trincot
    Nov 9 at 19:59














up vote
2
down vote

favorite












I am trying to parse a json object whith following code in python 3.



import json
str = '"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'
c = json.loads(str)
print(c['id'])


when I execute the script, I got an error:



json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 270 (char 269)


I have parsed many json objects with this code and can't understand what is wrong with it now, or what is wrong with this particular json object.



Regards.










share|improve this question



















  • 1




    One way to debug this is the load it into a json pretty printer and see if its able to parse or locate the error its pointing to
    – ritlew
    Nov 9 at 19:50










  • @ritlew I tried it and it's completely valid there.
    – Ali Crash
    Nov 9 at 19:55






  • 2




    Well, what is line 1 column 270 (char 269)?
    – cricket_007
    Nov 9 at 19:58






  • 1




    It is near a backslash.
    – trincot
    Nov 9 at 19:59












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am trying to parse a json object whith following code in python 3.



import json
str = '"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'
c = json.loads(str)
print(c['id'])


when I execute the script, I got an error:



json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 270 (char 269)


I have parsed many json objects with this code and can't understand what is wrong with it now, or what is wrong with this particular json object.



Regards.










share|improve this question















I am trying to parse a json object whith following code in python 3.



import json
str = '"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'
c = json.loads(str)
print(c['id'])


when I execute the script, I got an error:



json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 270 (char 269)


I have parsed many json objects with this code and can't understand what is wrong with it now, or what is wrong with this particular json object.



Regards.







python json






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 19:50

























asked Nov 9 at 19:47









Ali Crash

931210




931210







  • 1




    One way to debug this is the load it into a json pretty printer and see if its able to parse or locate the error its pointing to
    – ritlew
    Nov 9 at 19:50










  • @ritlew I tried it and it's completely valid there.
    – Ali Crash
    Nov 9 at 19:55






  • 2




    Well, what is line 1 column 270 (char 269)?
    – cricket_007
    Nov 9 at 19:58






  • 1




    It is near a backslash.
    – trincot
    Nov 9 at 19:59












  • 1




    One way to debug this is the load it into a json pretty printer and see if its able to parse or locate the error its pointing to
    – ritlew
    Nov 9 at 19:50










  • @ritlew I tried it and it's completely valid there.
    – Ali Crash
    Nov 9 at 19:55






  • 2




    Well, what is line 1 column 270 (char 269)?
    – cricket_007
    Nov 9 at 19:58






  • 1




    It is near a backslash.
    – trincot
    Nov 9 at 19:59







1




1




One way to debug this is the load it into a json pretty printer and see if its able to parse or locate the error its pointing to
– ritlew
Nov 9 at 19:50




One way to debug this is the load it into a json pretty printer and see if its able to parse or locate the error its pointing to
– ritlew
Nov 9 at 19:50












@ritlew I tried it and it's completely valid there.
– Ali Crash
Nov 9 at 19:55




@ritlew I tried it and it's completely valid there.
– Ali Crash
Nov 9 at 19:55




2




2




Well, what is line 1 column 270 (char 269)?
– cricket_007
Nov 9 at 19:58




Well, what is line 1 column 270 (char 269)?
– cricket_007
Nov 9 at 19:58




1




1




It is near a backslash.
– trincot
Nov 9 at 19:59




It is near a backslash.
– trincot
Nov 9 at 19:59












3 Answers
3






active

oldest

votes

















up vote
7
down vote



accepted










The solution is to use r in from of your string



str = r'"created_at":"Sun Aug 30 13:59:15 ...'


This helps interpret your str variable as a raw string so you won't have trouble with the backslashes inside the json string.






share|improve this answer





























    up vote
    0
    down vote













    Try putting r before the string in str. I just tried it and it worked for me. Check out Lexical Analysis for more info.



    str = r'"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'






    share|improve this answer



























      up vote
      0
      down vote













      In this part you could remove double quotes (") from html.



      "source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e"


      to



      "source":"u003ca href=http://twitterfeed.com rel=nofollowu003etwitterfeedu003c/au003e"


      the extra double quotes are creating cyclic errors in JSON parser and HTML is fine without double quotes inside elements.






      share|improve this answer




















        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232383%2fcant-parse-a-probably-valid-json-object%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        7
        down vote



        accepted










        The solution is to use r in from of your string



        str = r'"created_at":"Sun Aug 30 13:59:15 ...'


        This helps interpret your str variable as a raw string so you won't have trouble with the backslashes inside the json string.






        share|improve this answer


























          up vote
          7
          down vote



          accepted










          The solution is to use r in from of your string



          str = r'"created_at":"Sun Aug 30 13:59:15 ...'


          This helps interpret your str variable as a raw string so you won't have trouble with the backslashes inside the json string.






          share|improve this answer
























            up vote
            7
            down vote



            accepted







            up vote
            7
            down vote



            accepted






            The solution is to use r in from of your string



            str = r'"created_at":"Sun Aug 30 13:59:15 ...'


            This helps interpret your str variable as a raw string so you won't have trouble with the backslashes inside the json string.






            share|improve this answer














            The solution is to use r in from of your string



            str = r'"created_at":"Sun Aug 30 13:59:15 ...'


            This helps interpret your str variable as a raw string so you won't have trouble with the backslashes inside the json string.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 9 at 19:59

























            answered Nov 9 at 19:55









            Gabe

            31229




            31229






















                up vote
                0
                down vote













                Try putting r before the string in str. I just tried it and it worked for me. Check out Lexical Analysis for more info.



                str = r'"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'






                share|improve this answer
























                  up vote
                  0
                  down vote













                  Try putting r before the string in str. I just tried it and it worked for me. Check out Lexical Analysis for more info.



                  str = r'"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'






                  share|improve this answer






















                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    Try putting r before the string in str. I just tried it and it worked for me. Check out Lexical Analysis for more info.



                    str = r'"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'






                    share|improve this answer












                    Try putting r before the string in str. I just tried it and it worked for me. Check out Lexical Analysis for more info.



                    str = r'"created_at":"Sun Aug 30 13:59:15 +0000 2015","id":637987951842951168,"id_str":"637987951842951168","text":"The Truth About the Iran Vatican False Prophet Anglo-American Western Alliance for Antichrist Israel: Palestin... http://t.co/G79X164K9g","source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":"id":311859117,"id_str":"311859117","name":"Miko Furura","screen_name":"MikoFurura","location":"","url":null,"description":null,"protected":false,"verified":false,"followers_count":10,"friends_count":3,"listed_count":2,"favourites_count":4,"statuses_count":1264,"created_at":"Mon Jun 06 05:32:44 +0000 2011","utc_offset":32400,"time_zone":"Osaka","geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme7/bg.gif","profile_background_tile":false,"profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png","default_profile":false,"default_profile_image":true,"following":null,"follow_request_sent":null,"notifications":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":"hashtags":,"trends":,"urls":["url":"http://t.co/G79X164K9g","expanded_url":"http://bit.ly/1KvlIEu","display_url":"bit.ly/1KvlIEu","indices":[114,136]],"user_mentions":,"symbols":,"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"en","timestamp_ms":"1440943155619"'







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 9 at 20:08









                    Greg

                    11




                    11




















                        up vote
                        0
                        down vote













                        In this part you could remove double quotes (") from html.



                        "source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e"


                        to



                        "source":"u003ca href=http://twitterfeed.com rel=nofollowu003etwitterfeedu003c/au003e"


                        the extra double quotes are creating cyclic errors in JSON parser and HTML is fine without double quotes inside elements.






                        share|improve this answer
























                          up vote
                          0
                          down vote













                          In this part you could remove double quotes (") from html.



                          "source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e"


                          to



                          "source":"u003ca href=http://twitterfeed.com rel=nofollowu003etwitterfeedu003c/au003e"


                          the extra double quotes are creating cyclic errors in JSON parser and HTML is fine without double quotes inside elements.






                          share|improve this answer






















                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            In this part you could remove double quotes (") from html.



                            "source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e"


                            to



                            "source":"u003ca href=http://twitterfeed.com rel=nofollowu003etwitterfeedu003c/au003e"


                            the extra double quotes are creating cyclic errors in JSON parser and HTML is fine without double quotes inside elements.






                            share|improve this answer












                            In this part you could remove double quotes (") from html.



                            "source":"u003ca href="http://twitterfeed.com" rel="nofollow"u003etwitterfeedu003c/au003e"


                            to



                            "source":"u003ca href=http://twitterfeed.com rel=nofollowu003etwitterfeedu003c/au003e"


                            the extra double quotes are creating cyclic errors in JSON parser and HTML is fine without double quotes inside elements.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 9 at 20:18









                            Babak

                            1769




                            1769



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232383%2fcant-parse-a-probably-valid-json-object%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Kleinkühnau

                                Makov (Slowakei)

                                Deutsches Schauspielhaus