node-bot icon indicating copy to clipboard operation
node-bot copied to clipboard

server/api methods look for ewa

Open staminna opened this issue 9 years ago • 1 comments

Hi I am trying to make a request using the server/api methods but it cannot find ewa. I thought it wouldn't be necessary for this. Here's what I am doing.

'var http = require('http'), URL = require('url'), getElements = require('node-bot').getElements;

module.exports = { foo: function () { handleRequest(); }, bar: function () { google_node_bot(); } };

var handleRequest = function (request, response) {

var url = 'http://localhost:8999/getelements?name=nike_shoes&search=nike%20lebron%209&regexp=%5C%24%7C%C3%A2%E2%80%9A%C2%AC';

var qs = URL.parse(url);

if (qs.pathname == '/getelements'){ getElements(qs.query,response); }; console.log(response); };

function google_node_bot(){ console.log("google_node_bot is up"); http.createServer(handleRequest).listen(8999); }; '

I think the only difference is I am passing the request url as a variable. Thanks.

staminna avatar Mar 13 '16 15:03 staminna

The node-ewa module is the one that is parsing the page and extracting what is required according to the parameters passed, in fact you must write an equivalent module according to what you want to do (which I don't know)

Ayms avatar Mar 13 '16 17:03 Ayms