开发者

Using md5 on BeautifulSoup result

开发者 https://www.devze.com 2022-12-11 07:10 出处:网络
开发者_开发知识库Im trying to use the md5 algorithm on web pages to avoid seeing duplicates. Is there an easy way to convert the result from beautifulsoup into a string which is digestible by md5?

开发者_开发知识库Im trying to use the md5 algorithm on web pages to avoid seeing duplicates. Is there an easy way to convert the result from beautifulsoup into a string which is digestible by md5?

Many thanks


Just turn it into a string with str:

from BeautifulSoup import BeautifulSoup
doc = "<html><h1>Heading</h1><p>Text"
soup = BeautifulSoup(doc)

str(soup)

(from the docs)

0

精彩评论

暂无评论...
验证码 换一张
取 消