【发布时间】:2014-02-28 13:48:19
【问题描述】:
我有大量的网址。有些彼此相似,即它们代表相似的页面集。 例如。
http://example.com/product/1/
http://example.com/product/2/
http://example.com/product/40/
http://example.com/product/33/
相似。同样
http://example.com/showitem/apple/
http://example.com/showitem/banana/
http://example.com/showitem/grapes/
也类似。所以我需要将它们表示为http://example.com/product/(Integers)/
其中(Integers) = 1,2,40,33 和http://example.com/showitem/(strings)/ 其中strings = apple,banana,grapes ...等等。
python 中是否有任何内置函数或库可以从大量混合 url 中找到这些相似的 url?如何更有效地做到这一点?请建议。提前致谢。
【问题讨论】:
-
你需要用它们做什么?
-
我需要检测这些类型的 url 列表并将它们从一组不同的 url 中分组。
标签: python url optimization