report_generator.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:New-vulnerable-report-scraper- 作者: shamlikt 项目源码 文件源码
def scrape_fortinet(self, url):
        # ''' This method is used for parsing http://www.fortiguard.com/psirt'''
        data_fn = self.get_html_data(url)      # souping
        advisory_fn = data_fn.find('div', class_ ="results") # identifying the required tagset
        section_fn = advisory_fn.find_all('div', class_ ="title")
        for list in section_fn:
            temp_data_fn = deepcopy(self.value)
            temp_data_fn['val_name'] = list.text.strip()
            page_link_fn = "{}{}".format(url.strip('/psirt/'),list.a['href'])
            temp_data_fn['link'] = page_link_fn
            new_data_fn = self.get_html_data(page_link_fn)
            temp_data_fn['description'] = new_data_fn.find_all('div', class_="detail-item")[1].html.body.p.text.strip()

            new_table_fn = new_data_fn.find('table', class_="table table-responsive table-borderless")
            date = new_table_fn.find_all('tr')[1].find_all('td')[1].text.strip()
            temp_data_fn['date'] = datetime.strptime(date, '%b %d, %Y').date()
            temp_data_fn['severity'] = "Medium"
            temp_data_fn['affected'] = "Please find description"
            temp_data_fn['solution'] = "Information not available in website" 
            self.data.append(temp_data_fn) # appending temp data info to class variable called self.data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号