运行截图
记录日志
抓取启明星辰
def QMXCVuls(self, k=5):
browser = webdriver.Chrome() # 打开浏览器
# browser.maximize_window() # 最大化窗口
browser.minimize_window() # 最小化窗口
url = 'https://www.venustech.com.cn/new_type/aqtg/' # 以该链接为例
browser.get(url) # 访问相对应链接
info = browser.find_elements(By.CLASS_NAME,'safetyItem')
# print('QMXC')
num = 1
for i in info:
src = WebDriverWait(browser, 20).until(EC.visibility_of_element_located((By.XPATH,
f"/html/body/div/div[4]/div[2]/div/div[2]/ul/li[{num}]/a"))).get_attribute(
'href')
key = i.text.split('\n')
self.data.append({"name":key[0],"date":key[1],"src":src})
num +=1
if num== k+1:
break
browser.close() # 关闭浏览器
抓取腾讯云
def TencentVuls(self, k=5):
Tencent_url = "https://cloud.tencent.com/announce/ajax"
Tencent_data = {"action": "getAnnounceList",
"data": {"rp": k, "page": "1", "categorys": ["21"], "labs": [], "keyword": ""}}
Tencent_res = requests.post(url=Tencent_url, json=Tencent_data, headers=self.head)
Tencent_Text = Tencent_res.text
# print(Tencent_Text)
ret = eval(Tencent_Text)["data"]["rows"]
for i in ret:
self