When Python calls curl to access a webpage, it appears error:curl: (1) Protocol "' https" not supported or disabled in Libcurl
Console Direct Curl xxx is OK
Output = Subprocess.check_output (["Curl", "https://stackoverflow.com/questions/6884669/ Curl-1-protocol-https-not-supported-or-disabled-in-libcurl "]) # Errorprint (Output)
There is a solution, but this does not solve the problem, the original is a double quotation mark problem, replaced by quotation marks to solve the problem, always thought that but the quotation marks can represent the string, the specific why is not very clear, but to solve the problem, need to go deeper to understand, if you know please tell me the next
Output = Subprocess.check_output (["Curl", ' https://stackoverflow.com/questions/6884669/ Curl-1-protocol-https-not-supported-or-disabled-in-libcurl ']) # okprint (Output)
See demo is also single quote, curl supports but quotation marks? Tested the following pycurl are supported but quotation marks are the same
Import PYCURLC = Pycurl. Curl () c.setopt (C.url, ' https://www.taobao.com ') c.perform ()
Also the error:
Possible other reasons:
1, Curl does not support HTTPS can be viewed with curl-v
The workaround is to reinstall Curl for reference: http://www.codeweblog.com/curl%e4%b8%8d%e6%94%af%e6%8c%81https%e5%8d%8f%e8%ae%ae%e9%97%ae% e9%a2%98%e8%a7%a3%e5%86%b3/
wget HTTP://ARCHIVE.UBUNTU.COM/UBUNTU/POOL/MAIN/C/CURL/CURL_7.35.0.ORIG.TAR.GZTAR-XZVF CURL_7.35.0.ORIG.TAR.GZCD Curl_7.35.0.orig./configuremakesudo make Install
2, there is a space in quotation marks "https"
Python error:curl: (1) Protocol "' https" not supported or disabled in Libcurl