Glassdoor API Not Printing Custom Response
<p>I have the following problem when I try to print something from this api. I'm trying to set it up so I can access different headers, then print specific items from it. But instead when I try to print soup it gives me the entire api response in json format. </p>

<pre><code>import requests, json, urlparse, urllib2
from BeautifulSoup import BeautifulSoup   

url = "apiofsomesort"                

#Create Dict based on JSON response; request the URL and parse the JSON
#response = requests.get(url)
#response.raise_for_status() # raise exception if invalid response
hdr = {'User-Agent': 'Mozilla/5.0'}
req = urllib2.Request(url,headers=hdr)
response = urllib2.urlopen(req)
soup = BeautifulSoup(response)

print soup
</code></pre>

<p>When it prints it looks like the below:</p>

<pre><code>{
  "success": true,
  "status": "OK",
  "jsessionid": "0541E6136E5A2D5B2A1DF1F0BFF66D03",
  "response": {
    "attributionURL": "http://www.glassdoor.com/Reviews/airbnb-reviews-SRCH_KE0,6.htm",
    "currentPageNumber": 1,
    "totalNumberOfPages": 1,
    "totalRecordCount": 1,
    "employers": [{
      "id": 391850,
      "name": "Airbnb",
      "website": "www.airbnb.com",
      "isEEP": true,
      "exactMatch": true,
      "industry": "Hotels, Motels, &amp;amp; Resorts",
      "numberOfRatings": 416,
      "squareLogo": "https://media.glassdoor.com/sqll/391850/airbnb-squarelogo-1459271200583.png",
      "overallRating": 4.3,
      "ratingDescription": "Very Satisfied",
      "cultureAndValuesRating": "4.4",
      "seniorLeadershipRating": "4.0",
      "compensationAndBenefitsRating": "4.3",
      "careerOpportunitiesRating": "4.1",
      "workLifeBalanceRating": "3.9",
      "recommendToFriendRating": "0.9",
      "sectorId": 10025,
      "sectorName": "Travel &amp;amp; Tourism",
      "industryId": 200140,
      "industryName": "Hotels, Motels, &amp;amp; Resorts",
      "featuredReview": {
        "attributionURL": "http://www.glassdoor.com/Reviews/Employee-Review-Airbnb-RVW12111314.htm",
        "id": 12111314,
        "currentJob": false,
        "reviewDateTime": "2016-09-28 16:44:00.083",
        "jobTitle": "Employee",
        "location": "",
        "headline": "An amazing place to work!",
        "pros": "Wonderful people and great culture. Airbnb really strives to make you feel at home as an employee, and everyone is genuinely excited about the company mission.",
        "cons": "The limitations of Rails 3 and the company infrastructure make developing difficult sometimes.",
        "overall": 5,
        "overallNumeric": 5
      },
      "ceo": {
        "name": "Brian Chesky",
        "title": "CEO &amp;amp; Co-Founder",
        "numberOfRatings": 306,
        "pctApprove": 95,
        "pctDisapprove": 5,
        "image": {
          "src": "https://media.glassdoor.com/people/sqll/391850/airbnb-brian-chesky.png",
          "height": 200,
          "width": 200
        }
      }
    }]
  }
}
</code></pre>

<p>I want to print out specific items like employers":name, industry etc...</p>

<pre><code>import json, urlib2

url = "http..."

hdr = {'User-Agent': 'Mozilla/5.0'}
req = urllib2.Request(url, headers=hdr)
response = urllib2.urlopen(req)
data = json.loads(response.read())

# Print the values
print 'numberOfRatings:', data['response']['employers'][0]['numberOfRatings']
</code></pre>

python json api