水木社区手机版
首页
|版面-Web开发(WebDev)|
新版wap站已上线
返回
1/1
|
转到
主题:求教:url相对路径->绝对路径
3楼
|
XeCycle
|
2016-01-14 11:46:56
|
展开
> url.resolve("http://163.com/xxx", "abc.html")
'
http://163.com/abc.html'
> url.resolve("http://163.com/xxx/", "abc.html")
'
http://163.com/xxx/abc.html'
【 在 namoamituofo (如是我闻) 的大作中提到: 】
: 爬了一些href,有的是相对路径,我需要给他补成绝对路径,例如:
: 从
http://163.com/xxx
解析出href=abc.html
: 我给它补成
http://163.com/abc.html
: ...................
--
FROM 183.195.251.*
7楼
|
XeCycle
|
2016-01-14 13:00:09
|
展开
【 在 namoamituofo (如是我闻) 的大作中提到: 】
: 这是什么语言?
javascript
: 有python的吗?我是用python爬的
this is node.js core library, so is not for python; but I suppose any decent
web-related libs should resolve relative url in this way.
: 谢谢
--
FROM 183.195.251.*
1/1
|
转到
选择讨论区
首页
|
分区
|
热推
BYR-Team
©
2010.
KBS Dev-Team
©
2011
登录完整版