This commit is contained in:
MasonLiu committed 2024-12-25 22:57:42 +08:00
1 parent 353f1db25d
commit d4d1acdb72
40 files changed
+3711 -28

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
-9
View File
@@ -6,15 +6,6 @@ import json
from requests.exceptions import RequestException
from loguru import logger
logger.add("./log/spider.log",
format="{time:YYYY-MM-DD HH:mm:ss} - {level} - {name}:{function}:{line} - {message}",
rotation="10 MB",
compression="zip",
encoding="utf-8")
# shell终端打印日志
# logger.add(lambda msg: print(msg),
# format="{time:YYYY-MM-DD HH:mm:ss} - {level} - {name}:{function}:{line} - {message}")
# 测试用爬虫请求头
headers = {
"Content-Type": "application/json",
-9
View File
@@ -6,15 +6,6 @@ import json
from requests.exceptions import RequestException
from loguru import logger
logger.add("./log/spider.log",
format="{time:YYYY-MM-DD HH:mm:ss} - {level} - {name}:{function}:{line} - {message}",
rotation="10 MB",
compression="zip",
encoding="utf-8")
# shell终端打印日志
# logger.add(lambda msg: print(msg),
# format="{time:YYYY-MM-DD HH:mm:ss} - {level} - {name}:{function}:{line} - {message}")
# 测试用爬虫请求头
headers = {
"Content-Type": "application/json",
+18
View File
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
import os
import requests
import xml.etree.ElementTree as ET
import json
from requests.exceptions import RequestException
from loguru import logger
github_headers = {
'Authorization': f"token {github_token}"
}
# 抓取本年的
year = datetime.datetime.now().year
api = "https://api.github.com/search/repositories?q=CVE-{}&sort=updated".format(year)
json_str = requests.get(api, headers=github_headers, timeout=10).json()
-9
View File
@@ -5,15 +5,6 @@ import xmltodict
import json
from loguru import logger
logger.add("./log/spider.log",
format="{time:YYYY-MM-DD HH:mm:ss} - {level} - {name}:{function}:{line} - {message}",
rotation="10 MB",
compression="zip",
encoding="utf-8")
# shell终端打印日志
# logger.add(lambda msg: print(msg),
# format="{time:YYYY-MM-DD HH:mm:ss} - {level} - {name}:{function}:{line} - {message}")
# 测试用爬虫请求头
headers = {
"Content-Type": "application/atom+xml; charset=utf-8",