import requests
r = requests.get('https://www.vox.com/2018/9/25/17901082/trump-un-2018-speech-full-text')
r.encoding = 'utf8'
data = str(r.text)
begin = data.find('President Donald Trump’s')
end = data.rfind('Thank you very much. Thank you. (Applause.)')
print(data[91972:117325])

data = data.replace('\n', '')
data = data.replace("'", '')
data = data.replace('"', '')
data = data.replace('</p>', '')
data = data.replace('</a>', '')
data = data.replace(',', ' ')
data = data.replace('.', ' ')
data = data.replace('“', ' ')
data = data.replace('<a href="https://www.vox.com/world/2017/9/19/16332770/trump-unga-speech-north-korea-iran">', '')
data = data.replace('<p id="Qb42ol">', '')
data = data.replace('”', '')
data = data.replace('<p id="RrkDg9">', '')
data = data.replace('<p id="ehqHPE">', '')
data = data.replace('<p id="cicwjR">', '')
data = data.replace('<p id="F1i2LJ">', '')
data = data.replace('<a href="https://www.vox.com/policy-and-politics/2017/9/19/16333290/trump-full-speech-transcript-un-general-assembly">','')
data = data.replace('<p id="CKhBXm">', '')
data = data.replace('<hr class="p-entry-hr" id="FWI34g">','')
data = data.replace('<p id="DjzFI7">','')
data = data.replace('<p id="1JN4WY">', '')
data = data.replace('<p id="a1fKja">', '')
data = data.replace('<p id="uMK9dI">', '')
data = data.replace('<p id="64m7Jf">', '')
data = data.replace('<p id="gM44HV">', '')
data = data.replace('<p id="q3GM7z">', '')
data = data.replace('<p id="KGCi8L">', '')
data = data.replace('—', ' ')
data = data.replace('<p id="KsUeUC">', '')
data = data.replace('<p id="GiwrL6">', '')
data = data.replace('<p id="cR5RV5">', '')
data = data.replace('<p id="YDEq81">', '')
data = data.replace('<p id="Z6I5bq">', '')
data = data.replace('<p id="u2riPc">', '')
data = data.replace('<p id="Yx0P4B">', '')
data = data.replace('<p id="PmWmMj">', '')
data = data.replace('<p id="5PzzoY">', '')
data = data.replace('<p id="hyZJgK">', '')
data = data.replace('<p id="n2wvR5">', '')
data = data.replace('<p id="jAAkq5">', '')
data = data.replace('<p id="FXgaQ3">', '')
data = data.replace('<p id="rIO8UR">', '')
data = data.replace('<p id="8zjfzm">', '')
data = data.replace('<p id="j1YjtQ">', '')
data = data.replace('<p id="DTq7Xx">', '')
data = data.replace('<p id="HP7bJv">', '')
data = data.replace('<p id="YQiJ1M">', '')
data = data.replace('<p id="a7faPp">', '')
data = data.replace('<p id="bFDksK">', '')
data = data.replace('<p id="spVgTc">', '')
data = data.replace('<p id="ATCHk0">', '')
data = data.replace('<p id="GBwq44">', '')
data = data.replace('<p id="IXbqpy">', '')
data = data.replace(':', ' ')
data = data.replace('<p id="YyHi6Q">', '')
data = data.replace('<p id="Z7D9wR">', '')
data = data.replace('[', ' ')
words = data.replace(']', ' ')
data = data.replace('<p id="MF6Aj5">', '')
data = data.replace('2015', '')
data = data.replace('<p id="MF6Aj5">', '')
data = data.replace('40', '')
data = data.replace('<p id="BEZFrh">', '')
data = data.replace('5', '')
data = data.replace('<p id="aofXQa">', '')
data = data.replace('<p id="JaUr5K">', '')
data = data.replace('<p id="I5B3we">', '')
data = data.replace('<p id="fxkrxd">', '')
data = data.replace('<p id="dvYzvh">', '')
data = data.replace('<p id="qpJZur">', '')
data = data.replace('<p id="GrpRT3">', '')
data = data.replace('<p id="gmX2pq">', '')
data = data.replace('<p id="kG57U3">', '')
data = data.replace('<p id="ACghpr">', '')
data = data.replace('<p id="6wgp7q">', '')
data = data.replace('<p id="aAhymi">', '')
data = data.replace('60,000', '')
data = data.replace('$', '')
data = data.replace('13', '')
data = data.replace('<p id="arUKY9">', '')
data = data.replace('<p id="U032US">', '')
data = data.replace('250', '')
data = data.replace('<p id="oNMPwE">', '')
data = data.replace('<p id="HHfKGw">', '')
data = data.replace('<p id="VyREAn">', '')
data = data.replace('<p id="ho9d9B">', '')
data = data.replace('<p id="cF26si">', '')
data = data.replace('<p id="3TruLu">', '')
data = data.replace('<p id="mg3pQw">', '')
data = data.replace('<p id="gl0t4E">', '')
data = data.replace('<p id="w5LkMz">', '')
data = data.replace('<p id="PJ58ub">', '')
data = data.replace('<p id="LoDnTZ">', '')
data = data.replace('<p id="vbWlzm">', '')
data = data.replace('<p id="64ZSXC">', '')
data = data.replace('<p id="K4iZDx">', '')
data = data.replace('<p id="l4j77s">', '')
data = data.replace('<p id="oOzvaJ">', '')
data = data.replace('<p id="nWbjqU">', '')
data = data.replace('<p id="5fGqFK">', '')
data = data.replace('<p id="YfDLjI">', '')
data = data.replace('<p id="G97hic">', '')
data = data.replace('<p id="BkmM5D">', '')
data = data.replace('<p id="aCKAHN">', '')
data = data.replace('<p id="EdgTnP">', '')
data = data.replace('<p id="z5XIGd">', '')
data = data.replace('<p id="JG31ve">', '')
data = data.replace('<p id="LtvQ0U">', '')
data = data.replace('<p id="U0le6t">', '')
data = data.replace('<p id="wtVDOX">', '')
data = data.replace('<p id="ifFWwQ">', '')
data = data.replace('<p id="ygqENp">', '')
data = data.replace('<p id="mD77Vc">', '')
data = data.replace('<p id="TyBHek">', '')
data = data.replace('<p id="TFia8t">', '')
data = data.replace('<p id="mgVOrt">', '')
data = data.replace('70' ,'')
data = data.replace('<p id="2LeMOG">', '')
data = data.replace('<p id="vwedBc">', '')
data = data.replace('<p id="YLkHwj">', '')
data = data.replace('<p id="rmQW8I">', '')
data = data.replace('<p id="WPa6ga">', '')
data = data.replace('<p id="D3FUVt">', '')
data = data.replace('<p id="oeG0df">', '')
data = data.replace('<p id="uCDYdn">', '')
data = data.replace('<p id="ADSChO">', '')
data = data.replace('<p id="Aogf2Y">', '')
data = data.replace('<p id="68hVhn">', '')
data = data.replace('<p id="g9nuW5">', '')
data = data.replace('(', '')
data = data.replace(')', '')
data = data.replace('<p', '')
data = data.replace('vox-cdn' ,'')
data = data.replace('//cdn', '')
data = data.replace('0', '')
data = data.replace('<a', '')
data = data.replace('href=https' ,'')
data = data.replace('//www', '')
data = data.replace('<div', '')
data = data.replace('<span', '')
data = data.replace('</li>', '')
data = data.replace('’', ' ')
data = data.replace('<li>', '')
data = data.replace('data-analytics-link=nextclicks', '')
data = data.replace('data-analytics-viewport=nextclicks', '')
data = data.replace('com/uploads/chorus_image/image/62167689/106229', '')
data = data.replace('com/uploads/chorus_image/image/6218237/Screen_Shot_2018_11_04_at_10', '')
data = data.replace('4', '')
data = data.replace('17_', '')
data = data.replace('focal8x817', '')
data = data.replace('focal687x20', '')
data = data.replace('</div>', '')
data = data.replace('</span>', '')
data = data.replace('data-chorus-optimize-field=main_image', '')
data = data.replace('data-cdata={image_id', '')
data = data.replace('<script', '')
data = data.replace('=', ' ')
data = data.replace('/', '')
data = data.replace('00', '')
data = data.replace('186x1297/cdn', '')
data = data.replace('91x433/cdn', '')
data = data.replace('data-vars-analytics-link-title=The', '')
data = data.replace('2', ' ')
data = data.replace('<li', '')
data = data.replace('10', ' ')
data = data.replace('data-analytics-placement=sidebar', '')
data = data.replace('KiZDx>', '')
data = data.replace('lj77s>', '')
data = data.replace('oOzvaJ', '')
data = data.replace('nWbjqU>', '')
data = data.replace('fGqFK>', '')
data = data.replace('-', ' ')
data = data.replace('G97hic>', '')
data = data.replace('BkmMD>', '')
data = data.replace('aCKAHN>', '')
data = data.replace('EdgTnP>', '')
data = data.replace('zXIGd>', '')
data = data.replace('JG31ve>', '')
data = data.replace('LtvQU>', '')
data = data.replace('Ule6t>', '')
data = data.replace('wtVDOX>', '')
data = data.replace('ifFWwQ>', '')
data = data.replace('wtVDOX>','')
data = data.replace('jpg', '')                    
data = data.replace('id', '')
data = data.replace('data', '')
data = data.replace('class', '')
data = data.replace('https', '')
data = data.replace('comuploadschorus_imageimage6', '')
data = data.replace('>', '')
data = data.replace('type', '')
data = data.replace('vox', '')
data = data.replace('src', '')
data = data.replace('alt', '')
data = data.replace('6', '')

mydict = {}
words = data[91941:117298].split()

print(words)
for w in words:
    if w in mydict:
        mydict[w] +=1
    else:
        mydict[w] = 1

print('\nprint in value order reversed')
for k in sorted(mydict, key=mydict.__getitem__, reverse=True):
    print('%s:%s'%(k, mydict[k]))
