bing.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:jabbapylib3 作者: jabbalaci 项目源码 文件源码
def extract(test=False):
    text = requests.get(URL).text
    text = text.split('g_img={url:')[1]
    text = text.split(',')[0].replace("'", "").replace('"', '').replace("\\", "")
    img_url = urljoin(URL, text).replace(" ", "")
    fname = img_url.split('/')[-1]
    fname = unquote(fname).split('/')[-1]
    if not test:
        print('# img_url:', img_url)
        print('# fname:', fname)
    save_name = '{date}-{fname}'.format(date=get_date_from_year_to_day(),
                                        fname=fname)
    return (img_url, save_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号