When I do this:
s = response.xpath('//meta[@id="_bootstrap-neighborhood_card"]').extract()
what I get back is:
<meta content='{"hosting":{"id":2256573,"offset_lat":39.04258923718809,"offset_lng":-95.69083697887662},"map_url":"https://maps.googleapis.com/maps/api/staticmap?markers=%2C&size&zoom=14","place_recommendations":[],"neighborhood_breadcrumb_details":[{"link_text":"Southwest Fillmore Street,","search_text":"Southwest Fillmore Street Topeka, KS","link":"<span>Southwest Fillmore Street,</span>","link_route":"/s/Southwest-Fillmore-Street-Topeka--KS"},{"link_text":"Topeka,","search_text":"Topeka, KS","link":"<span>Topeka,</span>","link_route":"/s/Topeka--KS"},{"link_text":"Kansas,","search_text":"Kansas, United States","link":"<span>Kansas,</span>","link_route":"/s/Kansas--United-States"},{"link_text":"United States","search_text":"United States","link":"<span>United States</span>","link_route":"/s/United-States"}],"neighborhood_basic_info":null,"neighborhood_localized_name":null,"user_info":{"user_image":"<img alt=\"Elizabeth\" data-pin-nopin=\"true\" height=\"90\" src=\"https://a0.muscache.com/im/users/9199018/profile_pic/1380782460/original.jpg?aki_policy=profile_x_medium\" title=\"Elizabeth\" width=\"90\" />"}}' id="_bootstrap-neighborhood_card">
Which is clearly JSON but it's encoded (as you can see). I tried urllib.unquote
but that throws an error. AttributeError: 'list' object has no attribute 'split'
I was hoping to not have to resort to using a regex to do the URL decoding. What can I do (besides using a regex) to make this valid JSON?