Greetings. I have recently discovered the Grease Monkey add-in for FireFox. It has a lot of potential, and I am really enjoying using it to simplify and automate some repetitive tasks I perform on a regular (several times a day) basis.
Here is what I cannot figure out:
One site I visit (PHP) generates a list of links based on certain conditions (time of day, luck of the draw, who knows?). I want to click a SPECIFIC link if it exists. If not, I'd like to reload the page and try again.
The link I want is in the format [normal url].html / something.php?a =var1&b=var2
The var1 and var2 will change based on the conditions that I have yet to determine (see above). If that link shows up on the page somewhere, then I want to click it.
I tried to use an array and just pull the link if it is there, but the number of links on the page is not constant, and the position in the array for the specified link was not constant.
I worked a small amount with some Regular Expressions until my script stopped working altogether (leading me to believe I should have paid attention in my C++ classes a little more).
If you have any ideas, I'd love to give them a try. It just seems like I'm missing something really quite simple and would like to be able to automate this task (to keep from having to click refresh several times to find the link).
I want this to work in FireFox with GreaseMonkey (which just uses standard JavaScript).
Thank you for your help.
1 1925 acoder 16,027
Recognized Expert Moderator MVP
Welcome to TSDN!
Use document.getEle mentsByTagName( "a") to get the links on the page then loop over them to check that one of them is the correct link.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Newton |
last post by:
I'm having some issues with a greasemonkey script i've made (nothing
serious, and you'll notice that by the mess). I made it to learn
javascript properly at first but it ended handy and now i'm addicted to
it.. However, it doesn't quite work like i'd expect it to (and like it
used to with older versions) I realise that it may be a
greasemonkey-specific question, please bare with me if it is. I figured
some of you guys may have used it...
|
by: Alex |
last post by:
Sorry if this is not a correct forum to post to.
I have a page from my service provider that loads 1000's of table
cells. These cells load for 3-4 mins and links on that page usually not
available untill the whole page loads. I need to find a way to "skip"
load of these cells.
Problem is that GreaseMonkey work only on a fully loaded page. What
happens is that the page loads 3-4 mins and then the cells go away once
the page loads and...
|
by: Alexander Paul |
last post by:
Hi!
I'm a newbie to JavaScript and Greasemonkey and just started learning
with 'Dive Into Greasemonkey'. I looked for an example on the web, but
unfortunately I'm still missing something...
I have a text file which is a simple database:
Key01 Text01 Url01
Key02 Text02 Url02
|
by: 9icj4u613jeqrx8 |
last post by:
Hi,
I need some help with IE browser programming (in .NET).
I'm trying to add a button to the IE toolbar, and on the click of the
button open a popup window with a remote URL. Secondly, I'm trying to
highlight certain predefined words on particular web sites through the
IE plugin itself.
To add an IE button, I've found this neat article:
|
by: XtinaS |
last post by:
I'm trying to write a script for Greasemonkey that will, in LiveJournal, replace a placeholdered embedded YouTube thing with a link to the video. In LiveJournal, you can set an option to have a placeholder instead of the actual embedded YouTube video. This is what that code looks like:
<div class="LJ_Placeholder_Container" style="width: 475px; height: 405px;">
<div class="LJ_Placeholder_HTML" style="display:...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |