์น ์ฌ์ดํธ์ ๊ฐ๋จํ GET ์์ฒญ์ ํ๋ ค๊ณ ํฉ๋๋ค. https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb?utm_source=crunchbase_tc_river&utm_medium=export&utm_campaign=dataset
๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
throw new TypeError('Request path contains unescaped characters.');
^
TypeError: Request path contains unescaped characters.
at new ClientRequest (_http_client.js:53:11)
at TunnelingAgent.exports.request (http.js:31:10)
at TunnelingAgent.createSocket (/usr/lib/nodejs/tunnel-agent/index.js:117:25)
at TunnelingAgent.createSecureSocket [as createSocket] (/usr/lib/nodejs/tunnel-agent/index.js:184:41)
at TunnelingAgent.addRequest (/usr/lib/nodejs/tunnel-agent/index.js:80:8)
at new ClientRequest (_http_client.js:137:16)
at Object.exports.request (http.js:31:10)
at Object.exports.request (https.js:181:15)
at Request.start (/usr/lib/nodejs/request/index.js:607:30)
at Request.end (/usr/lib/nodejs/request/index.js:1235:28)
URL์ด ์์ฒญ ํจ์์์ ๋งค๊ฐ๋ณ์๋ก ์ ์ก๋๋๋ก ํธํ๋๋์ง ํ์ธํ๋ ์์ ์ฌํญ์ด ์์ต๋๊น? [email protected] ๋ฐ ๋ ธ๋ v5.5.0์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
๋น์ ๊ณผ ๊ฐ์ ๋ฒ์ ์ ์ฌ์ฉํ์ฌ ๊ทธ๊ฒ์ ํ ๋ ์ ์๋ํฉ๋๋ค.
'use strict';
const request = require('request');
request(
'https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb?utm_source=crunchbase_tc_river&utm_medium=export&utm_campaign=dataset',
(error, response, body) => {
if (error) {
return console.error(error);
}
return console.log(body.substr(0, 128) + '...');
}
);
์ฝ๋๋ฅผ ๊ฒ์ํ ์ ์์ต๋๊น?
์ค์ ์ค๋ฅ๋ฅผ ์ดํด๋ณด์์ต๋๋ค.
์ด ์ค๋ฅ๋ URL์ ๊ณต๋ฐฑ์ ์จ๊ฒผ์ ๋๋ง ๋ฐ์ํ ์ ์์ต๋๋ค. ์ด ๋ฐฉ๋ฒ์ ์๋ํ์ง๋ง ์์ฒญ์ ํญ์ ์ฌ๋ฐ๋ฅด๊ฒ ์ด์ค์ผ์ดํ ์ฒ๋ฆฌํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
์ค๋ํซ์ ๊ฒ์ํ๊ฑฐ๋ ์ต์ ๋ฒ์ (๊ทํ์ ๋ฒ์ ์ ์๋นํ ์ค๋๋ ๋ฒ์ )์ ์๋ํ๊ณ ์ค๋ฅ๊ฐ ์ง์๋๋์ง ํ์ธํด์ผ ํฉ๋๋ค.
๋๋ ํ๋ก์ ์๋ฒ ๋ค์์ ์ผํฉ๋๋ค. ๊ทํ์ ์ฝ๋๋ ํ๋ก์ ๋ค์์ ์๋ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์๋์ ๋ด ์ฝ๋๋ฅผ ๋ถ์ฌ๋ฃ์ต๋๋ค. ์ด๊ฒ์ด ํ๋ก์ ์๋ฒ ๋ค์์ ์์ ํ๋ ๋์ ์์ฒญ์ ๋ณด๋ด๋ ์ฌ๋ฐ๋ฅธ ๋ฐฉ๋ฒ์ธ์ง ์๋ ค์ฃผ์๊ฒ ์ต๋๊น?
'use strict';
const request = require('request');
var get_config = function(site_url){
var config = {
url : ((site_url)),
proxy : 'http://proxyhost:proxyport'
};
return config;
};
request(
get_config('https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb?utm_source=crunchbase_tc_river&utm_medium=export&utm_campaign=dataset'),
(error, response, body) => {
if (error) {
return console.error(error);
}
return console.log(body.substr(0, 128) + '...');
}
)
๋ํ ํฅ๋ฏธ๋ก์ด ๊ด์ฐฐ์ "https"๋ฅผ "http"๋ก ๋ฐ๊ฟ ๋ ์์ฒญ์ด ์ ๋๋ก ์๋ํ๋ค๋ ๊ฒ์ ๋๋ค.
ํ๋ก์๊ฐ https๋ฅผ ์ง์ํ์ง ์์ต๋๊น?
๋ด๊ฐ ์ ์ ์๋ ๋ฐ์ ๋ฐ๋ฅด๋ฉด ๋ด๋ถ์ ์ผ๋ก ์ผ๋ถ ๋ฆฌ๋๋ ์ ์ด ๋ฐ์ํ๊ณ ์์ง๋ง ๋ฆฌ๋๋ ์ ์ ๊ณต๋ฐฑ์ด ํฌํจ๋ ํ์์ด ์๋ชป๋/์๋ชป๋ URL์ด ์์ด ์ด ์ค๋ฅ๋ฅผ ํ์ํฉ๋๋ค.
๊ณต๊ฐ ๋๋ฆฌ์ธ์ธ ๊ฒฝ์ฐ ์ ๋ณด๋ฅผ ๊ฒ์ํ ์ ์์ต๋๊น?
๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ "/usr/lib/nodejs/request/index.js:607"์ ์ค๋จ์ ์ ์ถ๊ฐํ๊ณ ๋๋ฒ๊ฑฐ๋ฅผ ํตํด ์ ๋ฌ๋ URL์ ๊ฒ์ฌํ์ญ์์ค.
์๋ ํ์ธ์ @dsaumyajit007
์ด๊ฒ์ ๊ด์ฐฎ์ ๋ณด์ด๊ณ google.com
์ ์๋ฒฝํ๊ฒ ์๋ํ๋ฉฐ ์ฝ๋ ์ค๋ํซ ์ดํ์ ๊ฒฐ๊ณผ์
๋๋ค.
const request = require('request');
var get_config = function(site_url){
var config = {
url : ((site_url)),
proxy : 'http://proxyurl:proxyport'
};
return config;
};
request(
get_config('https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb')
, (function (error, response, body) {
console.log(response.statusCode);
console.error(error);
return console.log(body.substr(0, 128) + '...');
})
);
google.com
null
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en-IN"><head><meta content="text/html; charset=UTF-...
@sudheesh001 ๋ค๋ฅธ ํ๋ก์๋ฅผ ์ฌ์ฉ ์ค์ผ ์ ์์ต๋๋ค.
๊ทธ๋ฅผ ๊ธฐ๋ค๋ฆฌ์.
๋งค์ฐ ๊ธฐ๋ณธ์ ์ธ ์์ฌ์ด ์์ต๋๋ค. Ubuntu 14.04์์ Node js๋ฅผ ์คํ ์ค์ด๋ฉฐ ์คํ ์ค์
๋๋ค.
node --version
๋๋ v5.5.0์ ์ป๋๋ค. ์ด๋๊ฐ์์ ๋ฆด๋ฆฌ์ค๊ฐ 0.xx ์ธ ๊ฒ์ ๋ณด์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ด ๊ฐ์ฅ ์์ ์ ์ธ ๋ฆด๋ฆฌ์ค์
๋๊น? ์ฌ๋ฐ๋ฅธ ๋ฒ์ ์ Node๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๊น? https://nodejs.org/en/download/package-manager/#debian -and-ubuntu-based-linux-distributions์ ์ง์นจ์ ๋ฐ๋ผ ์ค์นํ์ต๋๋ค.
์, 0.x ๋ฆด๋ฆฌ์ค๋ iojs/nodejs ๋ณํฉ ์ด์ ์ ๊ฒ์
๋๋ค.
v5.5.0์ ์์ ์ ์
๋๋ค.
๋๋ ์ฌ์ ํ ๊ทธ๊ฒ์ด ๋จ์ง ๋น์ ์ ๋๋ฆฌ์ธ์ด ์ด์ํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
ํ์ธ. ๋งํฌ๊ฐ "https"๋ฅผ "http"๋ก ๋ฐ๊พธ๋ ๋ฐ ์๋ํ๋ ์ด์ ๊ฐ ์์ต๋๊น? ์ด๋ป๊ฒ ๋ ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํฉ๋๋ค
์ด์ ๋ง๋ฒ์ฒ๋ผ ์๋ํฉ๋๋ค. :+1:
๋ฐฉ๊ธ nodejs์ ์์ฒญ ํจํค์ง๋ฅผ ๋ค์ ์ค์นํ์ต๋๋ค. ๋ชจ๋ ๋์์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค @sudheesh001 @SimonSchick
์์ฒญ ๋ชจ๋์ ๋ค์ ์ค์นํ์ง๋ง์ด ์ค๋ฅ์ ๋ํด ๋ฉฐ์น ํ์ ์คํจํฉ๋๋ค.
๋๋ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์๋๋ฐ ์ฌ๊ธฐ์์ ๋ถํํ๋ ์ฌ๋๋ค์ด ํค๋ณด๋์์ ๋ค๋ฅธ ์ธ์ด๋ฅผ ํ์ฑํํ๋์ง ๊ถ๊ธํฉ๋๋ค. ๋๋ ์๋์ด/์์ด๊ฐ ์์ต๋๋ค. ์ด๊ฒ์ ์กฐ์ฌํ๋ ๋์ ์ฐ๋ฆฌ๋ฅผ ์ด๋๊ฐ๋ก ๋ฐ๋ ค๊ฐ ์ ์์ต๋๋ค
Windows(์ด๋๋ท์์ ํ ๋คํธ์ํฌ๋ก)์์๋ ์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ง๋ง macOS(๋์ผํ ๋คํธ์ํฌ๋ก์ Wi-Fi)์์๋ ๋ฐ์ํ์ง ์์ต๋๋ค. http
ํธ๋ฆญ์ด ์๋ํ์ง ์์ต๋๋ค.
let url = 'http://localhost:30001?q=ะฐะฐะฑะฑะฒะฒะณะณะดะด'
axios.get(encodeURI(url)).then( data => {
})
์์ฒญ์ ์ฌ์ฉํ์ฌ kubernetes ํ๊ฒฝ์์ ์์ฒญ ๋ฐ๊ธฐ
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
let url = 'http://localhost:30001?q=ะฐะฐะฑะฑะฒะฒะณะณะดะด'
axios.get(encodeURI(url)).then( data => { })