Skip to content

Commit 59b89a7

Browse files
committed
更新url解析工具类
1 parent 175a146 commit 59b89a7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/url.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ def test():
3030

3131

3232
if __name__ == '__main__':
33-
test()
33+
test()
34+
test_url = 'http://suining.58.com/zhongdiangong/?sort=pingfen'
35+
print urlparse(test_url).hostname.rstrip('.58.com')
36+
print urlparse(test_url).path.strip('/')

0 commit comments

Comments
 (0)