def get_url(poi, sub_page):
    """
    用来构建一个完整的请求url
    :param poi: 父景点的poiid
    :param sub_page: 要爬取父景点的子景点页数
    :return: url_complete(一个完整的请求url)
    """
    get_url_base = "http://pagelet.mafengwo.cn/poi/pagelet/poiSubPoiApi"

    json_base_1 = "?params=%7B%22poi_id%22%3A%22"
    json_base_2 = "%22%2C%22page%22%3A"
    json_base_3 = "%7D"

    json_str = json_base_1 + str(poi) + json_base_2 + str(sub_page) + json_base_3
    url_complete = get_url_base + json_str

    return url_complete