利用request庫請求api

import requests

def re():
    
    url = 'http://shuyantech.com/api/entitylinking/cutsegment?q='
    word = '打球的李娜和唱歌的李娜不是同一個人'
    url = url + word
    r = requests.get(url)
    print(r.text)
if __name__ == "__main__":
    count = 0
    while(True):
        re()
        count = count + 1
        print(count)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章