def get_script_content_in_js(self): ''' 描述: 从js文件中获取script内容 ''' scriptContentList = [] for js in self.get_script_tag_js_list: request = Requset(js, 1) request.run() req = request.get_text() if req is not None: scriptContentList.append(req) return scriptContentList
def get_style_content_in_css(self): ''' 描述: 从css样式中获取style内容 ''' styleContentList = [] for css in self.get_link_tag_css_list: request = Requset(css, 1) request.run() req = request.get_text() if req is not None: styleContentList.append(req) return styleContentList