Giter Club home page Giter Club logo

pagecut's Introduction

安装依赖selenium
在服务器中安装chrome浏览器和chromedriver,需要相同版本
将14行的chromedriver改为你的chromedriver的路径
45行C:\nb2\mimibot\src\plugins\pcr-rank\img\imgs中的C:\nb2\mimibot\src\plugins\pcr-rank\img改为你RES_DIR的路径

新增获取网页源代码功能,以辅助其他爬虫插件爬取动态网站(如必须真实浏览器访问才能获得的js变量)

指令:[获取网页源代码 + 链接 + 类型]

  • 类型可选:
    • "src":爬取全站源代码
    • "jsvar":爬取特定js变量,使用此类型时还需要输入js变量名

爬取到信息以后会保存在目录下data.txt

效果如图
图片
已知问题:会阻塞其他事件,当访问的链接加载较慢,会影响其他事件的响应

pagecut's People

Contributors

g41mywaifu avatar kcn3388 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pagecut's Issues

对url检查不严谨存在文件读取漏洞

项目存在任意文件读取漏洞,原因是对传入url协议的判断不严谨

    if 'http://' not in path and 'https://' not in path:
        path='http://'+path

构造file://xxxx?http://即可绕过检查
利用
修复建议:改用startswith检查url

报错

[2022-07-03 16:31:49,370 网页截图] ERROR: <class 'AttributeError'> occured when pic handling message -1905334272.
[2022-07-03 16:31:49,370 网页截图] ERROR: 'list' object has no attribute 'startswith'
Traceback (most recent call last):
File "/hobot/hoshino/msghandler.py", line 28, in handle_message
await service_func.func(bot, event)
File "/hobot/hoshino/modules/pagecut/page.py", line 46, in pic
if not path.startswith(('http://','https://')):
AttributeError: 'list' object has no attribute 'startswith'
[2022-07-03 16:31:49,371 nonebot] INFO: Message -1905334272 is ignored: Handled by Hoshino

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.