General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Can K-Meleon macros interact with Web pages?
Posted by: dtronvig
Date: March 13, 2008 07:19PM

I just stumbled onto K-Meleon and I may well have missed something obvious, but can K-Meleon macros interact with Web pages, like fill in a named text box or activate a named button? If it can, please point me toward a relevant example.

If K-Meleon macros can't do this, can anyone suggest a fast and cheap setup that will do that sort of thing? Web Macros with K-Meleon perhaps? Some little browser with built-in scripting to do that?

Thanks,
Drew

Options: ReplyQuote
Re: Can K-Meleon macros interact with Web pages?
Posted by: kko
Date: March 13, 2008 08:02PM

Macros can interact with web pages to a certain degree. For instance, they can dynamically generate JavaScript code and inject it into a page. Here is a good point to start at. The default macros demonstrate the usage (Edit > Configuration > Macros).

Options: ReplyQuote
Re: Can K-Meleon macros interact with Web pages?
Posted by: dtronvig
Date: March 13, 2008 09:06PM

Thanks kko.

I've poked around through the K-Meleon macros folder and so far I haven't found a macro that uses injectJS. Windows Explorer can't find one either. I may be looking for the wrong thing. If any particular example jumps to mind, please let me know.

I'm a little hazy about JavaScript, but if I do inject some into an open page, could I get it to execute right now, rather than it needing to be launched by a button or something? If I can make that happen, will JavaScript let me fill in a named text area and essentially click a given button?

Given that I'm pretty ignorant about JavaScript in any case, is there that fast cheap combination of Web-macro software and a tiny fast browser? Is there a good Web-page-level macro package that works well with K-Meleon?

Just to give an idea of what I'm trying to do, I'm trying to reserve a campsite on a reservation server that will let you book a site a certain number of months in advance. Any request that arrives before the exact time that sites become available for that day will be rejected. The first request that arrives just after that time will get the site.

Given that my clock could be a second or two out of sync with the server's clock and there's some delay before my request gets to the server, I want to be sending about 100 requests per second over a five-second period. Since the server response gets back in about a second, that would mean about 100 windows or tabs repeatedly sending the same request, or about 500 windows or tabs each sending that request once.

I've tried to set this up sending requsts through cURL, but somehow I can't work out the proper request, though any browser can do it when the button is clicked.

Somehow I need to automate setting up those windows and getting each of them to click the pertinent button. Seems like pretty straightforward scripting, and I could probably do it with Web Macros and Firefox, except I don't know if the system will get bogged down with this happening in 100 or so windows, which is why I'm looking for the most efficient combination of browser and macro control.

Would K-Meleon be a likely browser for that, and if so what would you use to automate it on a button-clicking sort of level? If JavaScript will do that and I can get a simple comparable script, that works for me.

Thanks very much for any further help,
Drew

Options: ReplyQuote
Re: Can K-Meleon macros interact with Web pages?
Posted by: kko
Date: March 13, 2008 10:53PM

Well, shooting from the hip I can't provide you with any way to automatically click a button on a page through JavaScript. I don't know any.

Principally you only need to figure out what data the page is sending to the server when you press the button. Then you can use an appropriate program or HTML+JavaScript+browser to send this data automatically. But when you can't figure out what the page is sending, I can't help you either... (Live HTTP Headers might help)

Options: ReplyQuote
Re: Can K-Meleon macros interact with Web pages?
Posted by: dtronvig
Date: March 13, 2008 11:54PM

Thanks,

Yeah, I've run into some kind of weird problem setting up the right request and/or cookies or whatever. If I could do that, I could just use cURL. I'm setting up a macro right now, using Web Macros, which I hope will work with K-Meleon. All I really need is something to fill in two text fields and click one button. Everything else I can do with keybord macros, but they can't reliably find the webpage elements.

Thanks very much for tryin',
Drew

Options: ReplyQuote
Re: Can K-Meleon macros interact with Web pages?
Posted by: JamesD
Date: March 14, 2008 01:11PM

Quote
dtronvig
I've poked around through the K-Meleon macros folder and so far I haven't found a macro that uses injectJS. Windows Explorer can't find one either. I may be looking for the wrong thing. If any particular example jumps to mind, please let me know.

Main.kmm uses injectjs. Windows search will not find items in macros because Windows does not know that the kmm extention is text, I think. You must edit each macro and use find in order to see items within the macro.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.