封装与调用

原文链接:http://www.cnblogs.com/zhangbao003/p/8916253.html

__init__参数传递,url提取

import requests
import re

class Test():

    def __init__(self,s):
        self.s = s

    def bb(self,url):
        r=self.s = s.get(url,verify=False)
        print(r.text)

if __name__ == '__main__':
    s = requests.session()
    aa = Test(s)
    url = "https://jctcg.9caitong.com/"
    aa.bb(url)

  

 

 

 

转载于:https://www.cnblogs.com/zhangbao003/p/8916253.html

原文链接:加载失败,请重新获取