urljoin function 路徑問題
2019/12/29 03:24 下午
Python網路爬蟲討論版
葉碩涵
觀看數:2
回答數:1
收藏數:2
pycrawler
想問urljoin('絕對路徑','相對路徑')
我在網路上查到
urljoin("http://www.chachabei.com/abc/folder/currentpage.html", "/folder2/anotherpage.html")
答案會是
'http://www.chachabei.com/folder2/anotherpage.html'
想請問要怎麼知道相對路徑應該拼在絕對路徑的哪個位置??
我的理解是'http://www.chachabei.com/abc/folder2/anotherpage.html'
然而解答中/abc並不會存在
謝謝