I have a webpage which has an unknown number of links, probably about 100. Every day the links will be different. I want to open each link. The page that each link leads to will have either a text input or a drop down or both, and a submit button. I want to enter something in the input, select something from the dropdown, and click submit. The name of the text input will be the same for every link, as will the name of the dropdown and the list of options in the dropdown. I have tried using a firefox plugin called selenium but it seems it will only work if I know in advance what the links will be, which I don't, and that in order to do what I want I need to install something called selenium rc, which is too much work. I should be able to do this simply with PHP. I can also use Perl or Python if this task is easier done in those langs, but I am somewhat less familiar with them than with PHP so would prefer php.
I would use GreaseMonkey (a Firefox extension which uses JavaScript) to run down the page and open every link. var allLinks = document.getElementsByTagName("a"); var counter = 0; for (var i=0; i<allLinks.length; i++) { var myLink = allLinks[i]; var urlmatch = myLink.href.match( test ); if (urlmatch !== null) { if (counter < max) window.open(myLink.href); counter++; } } Code (markup): then have another GM script that runs "onload" that looks for an input with the right name, fills it in and submits the form. The big problem is identifying the 100 links and only running the "onload" script for those pages, not for every page you open during your normal day. Shouldn't be hard to work out though. You could possibly create a frame system using the link as a parameter and then GM could look to see if the parent of the current page is the frame and then it would know to run.