python get方式取url里的值

  from urllib.parse import parse_qs

def url_get_value(urlr,value_name):
    my_vloue = parse_qs(urlr,keep_blank_values=True)
    return my_vloue.get(value_name)[0]

uc = "do=4&t=5&name=jin"

print(url_get_value(uc,"name"))

评论

刷新

友情链接