Answer the question
In order to leave comments, you need to log in
How to simulate user actions with Javascript?
It is necessary to press buttons on the page, depending on the data on the same page.
Those. parse and then automate user actions. I was advised PhantomJS, but this is a console tool, and you need the page and all actions to be visible on the screen in real time. Is that possible?
Answer the question
In order to leave comments, you need to log in
The plugin for the greasemonkey/tampermonkey browser will allow you to pull your javascript on the condition of opening pages by regexp with full access rights (i.e. including iframe). There is a nuance to simultaneously open tabs, since tabs not in the background work with lower priority and speed (and some web applications themselves track what is not in the background and turn off part of the activity), this is generally solved by your browser based on ready-made controls such as webkit or . net WebBrowser (there is one for any platform, ten lines of browser code is obtained).
Click either by simulating events or by pulling the $('selector').click(); There are nuances with the work of the select tag or support for character-by-character data entry in smart inputs, but solvable.
A function that fires an event on an element:
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question