Skip to content

Instantly share code, notes, and snippets.

#Extract the Cost, Facility, Faculty, Programme, Student and Recruiter data from The Economist
# Ranking, Application and Accreditation details are not required for our analysis
root_web = 'http://www.economist.com/'
university_school_details = []
for j in range(100):
for k in range(9):
if (k != 0 and k != 2 and k != 8):
school_full_url = root_web + univ_school_url[j] + '?tab=' + str(k)
response = opener.open(school_full_url)
#Python code for scraping Economist website and fetching Business school ranking data
#using Beautiful Soup
import urllib2
import re, requests
from bs4 import BeautifulSoup
opener = urllib2.build_opener()
opener.addheaders = [('User-agent', 'Chrome/52.0')]
university = []
#Extract the first level of information about the university B'schools, ranks and their locations
for i in range(10):
### Code for Insight: Responses tab
choiceResponseInsight <- reactive({
capitalize(input$responseInsightRB)
})
output$txtResponseInsight <- renderText({
if (choiceResponseInsight() == "% Disputed Responses") { "Percentage of Disputed Responses" }
if (choiceResponseInsight() == "% Delayed Responses") { "Percentage of Delayed Responses" }
if (choiceResponseInsight() == "% Cases closed with Monetary Relief") { "Percentage of Cases closed with Monetary Relief" }
print (choiceResponseInsight())
### Code for Insight: Map tab
# Displaying data of interest
choiceResponseMap <- reactive({
capitalize(input$responseMapRB)
})
output$txtMap <- renderText({
if (choiceResponseMap() == "Volume of Complaints") { "Volume of Complaints" }
if (choiceResponseMap() == "% Disputed Responses") { "Percentage of Disputed Responses" }
if (choiceResponseMap() == "% Delayed Responses") { "Percentage of Delayed Responses" }
print (choiceResponseMap())