我有一大組網址。有些類似於彼此,即它們代表相似的一組頁面。 例如。python中類似網址的分組列表
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?這如何更有效地完成?請建議。提前致謝。
你需要怎麼處理它們? – msvalkon
我需要檢測這些類型的網址列表並將它們從一組不同的網址分組。 – Bishwash