pycharm版权文件模板设置

# -*- coding: utf-8 -*-
# Copyright (C) ${DATE} ${TIME} Seven, Inc. All Rights Reserved 

import requests, time, logging
from bs4 import BeautifulSoup


def get_proxy():
    ip = ''
    proxies = {'http': ip, 'https': ip}
    return proxies


proxies = get_proxy()
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'}


def log(message, level=logging.INFO):
    logging.basicConfig(level=level, format='%(asctime)s %(levelname)s: %(message)s')
    logging.log(level, message)


def get():
    url = ''
    r = requests.get(url, headers=headers,proxies=proxies)
   
if __name__ == '__main__':
    get()

在新建立文件夹的时候自动生成 方便备用很是方便!

THE END