Compare commits

...

4 Commits

Author SHA1 Message Date
776df13ed8 fix: 合并代码 2023-09-28 16:11:40 +08:00
336250ab66 fix: 删除device.json和session.token 2023-09-28 16:08:23 +08:00
c43d79d9a6 fix: 修改git忽略文件规则 2023-09-28 16:06:53 +08:00
66822bdfce fix: 使用selenium抓取文章内容 2023-09-27 10:01:34 +08:00
4 changed files with 6 additions and 4 deletions

2
.gitignore vendored
View File

@ -140,5 +140,5 @@ dmypy.json
# End of https://www.toptal.com/developers/gitignore/api/python
.idea
cqhttp/data
session.token
device.json
session.token

View File

@ -23,7 +23,7 @@ account: # 账号相关
# sign-server: 'http://127.0.0.1:8080' # 本地签名服务器
# sign-server: 'https://signserver.example.com' # 线上签名服务器
# 服务器可使用docker在本地搭建或者使用他人开放的服务
sign-server: 'http://127.0.0.1:5709/'
sign-server: 'http://dawang.xiaoyan159.space:5709/'
heartbeat:
# 心跳频率, 单位秒

Binary file not shown.

View File

@ -74,6 +74,7 @@ def getWenzhangInfo():
chrome_option.add_argument('--no-sandbox') # 解决DevToolsActivePort文件不存在的报错
chrome_option.add_argument('--disable-gpu') # 谷歌文档提到需要加上这个属性来规避bug
chrome_option.add_argument('--hide-scrollbars') # 隐藏滚动条, 应对一些特殊页面
chrome_option.add_experimental_option('excludeSwitches', ['enable-automation'])
chrome_option.add_argument('--headless')
browser = Chrome(executable_path=driver_path, options=chrome_option)
@ -103,8 +104,9 @@ def getWenzhangInfo():
url = data["url"]
if url:
# 请求文章正文内容
wenzhangGet = browser.get(url)
print(wenzhangGet.text)
browser.get(url)
element = browser.find_element(by='XPATH', value="//article")
print(element)
# author = None
# if data.find("太能喵")>0:
# weitoutiaoMap["太能喵"] = weitoutiaoMap["太能喵"]+1