import requests # 定义爬取url地址 base_url = 'https://www.baidu.com/' # 定义代理IP地址 proxies = {'http':'http://121.31.193.38:8123'} # 使用代理获取想要的页面 response = requests.request('get', base_url, proxies=proxies) print(response.content.decode('utf-8'))