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

click() method throwing some jQuery related errors

Open misu200 opened this issue 8 years ago • 5 comments

My first 'osmosis' project :) but when I am trying to click() a form submit button getting the following errors and the form seems not to get submitted:

(get) starting (get) loaded [get] http://www.mj.romarhiva.ro/Webarchive2014/SearchInscriere.aspx TypeError: Cannot read property 'expando' of null at //code.jquery.com/jquery-1.9.1.js:1446:80 at //code.jquery.com/jquery-1.9.1.js:1546:3 at //code.jquery.com/jquery-1.9.1.js:9597:3 at Object.Window.eval (/root/osmosis/test/node_modules/libxmljs-dom/lib/Window.js:101:20) at /root/osmosis/test/node_modules/libxmljs-dom/lib/Window.js:133:28 at /root/osmosis/test/node_modules/libxmljs-dom/lib/HttpRequest.js:39:9 at done (/root/osmosis/test/node_modules/needle/lib/needle.js:357:7) at PassThrough. (/root/osmosis/test/node_modules/needle/lib/needle.js:546:9) at emitNone (events.js:85:20) at PassThrough.emit (events.js:179:7) ReferenceError: jQuery is not defined at //code.jquery.com/ui/1.10.4/jquery-ui.js:315:5 at Object.Window.eval (/root/osmosis/test/node_modules/libxmljs-dom/lib/Window.js:101:20) at /root/osmosis/test/node_modules/libxmljs-dom/lib/Window.js:133:28 at /root/osmosis/test/node_modules/libxmljs-dom/lib/HttpRequest.js:39:9 at done (/root/osmosis/test/node_modules/needle/lib/needle.js:357:7) at PassThrough. (/root/osmosis/test/node_modules/needle/lib/needle.js:546:9) at emitNone (events.js:85:20) at PassThrough.emit (events.js:179:7) at endReadableNT (_stream_readable.js:906:12) at nextTickCallbackWith2Args (node.js:474:9) ReferenceError: $ is not defined at http://www.mj.romarhiva.ro/Webarchive2014/SearchInscriere.aspx at Object.Window.eval (/root/osmosis/test/node_modules/libxmljs-dom/lib/Window.js:101:20) at Object.Window.__evalScripts (/root/osmosis/test/node_modules/libxmljs-dom/lib/Window.js:144:20) at /root/osmosis/test/node_modules/libxmljs-dom/lib/Window.js:135:24 at /root/osmosis/test/node_modules/libxmljs-dom/lib/HttpRequest.js:39:9 at done (/root/osmosis/test/node_modules/needle/lib/needle.js:357:7) at PassThrough. (/root/osmosis/test/node_modules/needle/lib/needle.js:546:9) at emitNone (events.js:85:20) at PassThrough.emit (events.js:179:7) at endReadableNT (_stream_readable.js:906:12) (click) clicking input UNU:{"inputs":["__VIEWSTATE","__VIEWSTATEGENERATOR","__EVENTVALIDATION","DocumentID","Button1","onlyActiveCheck","startCheck","startDate","notModifiedCheck","endCheck","endDate","b_ipotecaMobiliara","b_createSecuritizate","b_avizSpecific","b_fiducie","b_obligatiuniIpotecare"]}

Source program:

var osmosis = require('osmosis');

osmosis .get('http://www.mj.romarhiva.ro/Webarchive2014/SearchInscriere.aspx') .click('#b_ipotecaMobiliara') .set({ 'inputs': ['input@name'] })

.data(function(listing) { // do something with listing data console.log("UNU:"+JSON.stringify(listing)); })

.log(console.log) .error(console.log)

.debug(console.log)

I ve been a casperjs/phantomjs fan until now ..... but the 'osmosis' project looks extremly intersting and light compared to that....

misu200 avatar Jan 29 '16 04:01 misu200

This error is caused by the way certain DOM CSS properties are handled. This will be fixed in the next release. In the mean time, you could submit the form using .submit(selector, [data]).

rchipka avatar Feb 26 '16 23:02 rchipka

I have the same problem, do you know when this next release will be pushed?

valentinLecorps avatar May 01 '16 23:05 valentinLecorps

I am also facing problems with .click(selector). I also tried .trigger('click', selector) and it didn't work.

I hope to see the fix soon.

nashwaan avatar Jul 21 '16 07:07 nashwaan

same problem here.

rustanacexd avatar Apr 10 '17 11:04 rustanacexd

so how can I simulate a click? this is not a submit form

rustanacexd avatar Apr 10 '17 11:04 rustanacexd