GithubHelp home page GithubHelp logo

Comments (3)

chinatelacom avatar chinatelacom commented on July 24, 2024

还有就是有些网站访问不存在地址时返回的响应码为200 这时候会导致 Dir.txt中的所有内容都会存储到urlout.txt中 可不可以加上一个判断 如果返回包的hash一致则不保存
import hashlib
encountered_hashes = set()
valid_pages = []
content_hash = hashlib.md5(r.content).hexdigest()
if content_hash not in encountered_hashes:
# 如果是新的哈希值,保存页面内容并记录哈希值
valid_pages.append(r.content)
encountered_hashes.add(content_hash)
f2 = open("urlout.txt", "a")
f2.write(u + '\n')
f2.close()
else:
# 如果哈希值已存在,忽略该页面内容
print(f"已存在{url}")

from springboot-scan.

AabyssZG avatar AabyssZG commented on July 24, 2024

已经收到师傅的反馈,我会再优化优化相关的内容🤩
之前就已经想到对页面Hash进行校验的想法哈哈~

from springboot-scan.

chinatelacom avatar chinatelacom commented on July 24, 2024

嗯嗯 期待更新😁

from springboot-scan.

Related Issues (15)

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.