# -*- coding: utf-8 -*-
import urllib.request
import json
import requests
import os
path = 'D:\\weibo'
#id = '[url=tel:2093492691]2093492691[/url]'这里决定爬取人的ID
id = '[url=tel:6049590367]6049590367[/url]'
proxy_addr = "122.241.72.191:808"
pic_num = 0
weibo_name = "programmer"
def use_proxy(url, proxy_addr):
req = urllib.request.Request(url)
req.add_header("User-Agent",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0")
proxy = urllib.request.ProxyHandler({'http': proxy_addr})
opener = urllib.request.build_opener(proxy, urllib.request.HTTPHandler)
urllib.request.install_opener(opener)
data = urllib.request.u