- 论坛徽章:
- 13
|
本帖最后由 hmchzb19 于 2015-01-16 16:53 编辑
我这个脚本本意是想通过加header 来达到下载的目的,后来发现,还是下载不到,估计是cookie 或者是referer 带来的问题。
然后这里讨论的是另外一个问题一个变量的展开:
curlcmd 如何展开并处理中间的空格- cookies="fc_cookies.txt"
- curlcmd="curl -A User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebK7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 -L -k -s -S -b $cookies -c $cookies -v"
- #Post 先拿到authentication
- $curlcmd -d $fc_auth_data $fc_auth_url --output fc_auth.html
- #保存文件
- $curlcmd "$fc_orderfix$package" --output "fc_$package.html"
复制代码 出错信息如下:- + curl -A User-Agent: Mozilla/5.0 '(Windows' NT '6.1)' AppleWebK7 '(KHTML,' like 'Gecko)' Chrome/16.0.912.75 Safari/535.7 -L -k -s -S -b fc_cookies.txt -c fc_cookies.txt -v -d 'username=××××××&password=×××××&login-form-type=pwd' https://××××××××××××××××× --output fc_auth.html
- * getaddrinfo(3) failed for Mozilla:80
- * Couldn't resolve host 'Mozilla'
- * Closing connection #0
- curl: (6) Couldn't resolve host 'Mozilla'
- * getaddrinfo(3) failed for (Windows:80
- * Couldn't resolve host '(Windows'
- * Closing connection #0
- curl: (6) Couldn't resolve host '(Windows'
- * getaddrinfo(3) failed for NT:80
- * Couldn't resolve host 'NT'
- * Closing connection #0
复制代码 |
|