Automate clicking on links on a website to add items to cart

1

Usually I use the DownThemAll! plugin for Firefox when I come across a website from which I want to download a lot of files at ones.

However, I am now confronted with the task to click on all links on a website which fulfill a certain requirement (in this case: having the word "cart" in the link text for example). This would then add items to a "shopping cart" on this website from which I can easily download files.

Does anybody know a plugin which is capable of doing this? I would want to list the requirements (link text, link image, etc.) for the links to be clicked and the plugin should handle the rest.

I have already fooled around with the DownThemAll! AntiContainer plugin, however, this would only be helpful if I wanted to directly download the files behind the aforementioned links. I really just want certain links that I specify to be clicked on.

Any help is really appreciated!

Edit: I had a look at Selenium for a few hours, but I am unable to get the things done I am looking for. It seems that I am not able to identify any link, css or whatever with regular expression (I always get errors that the locator I am looking for is not found).

<tr>
<td>verifyText</td>
<td>regexp:.*clicking.*</td>
<td></td>

is not found on this page for example.

Even if I would be able to let Selenium click a certain link for me, how would I automate it for all the links the fulfill my requirements? It seems that only the first match for a certain target specification is found by Selenium!?

Harald

Posted 2015-08-18T12:17:14.493

Reputation: 25

I see you've tried to make an edit with a new account as that one was unregistered. To merge them, use the contact form.

– MC10 – 2015-08-18T14:52:08.990

Answers

0

You can use the Selenium IDE Firefox plugin to automate clicking on links which contain only certain text like you're looking for.

Ben Sampica

Posted 2015-08-18T12:17:14.493

Reputation: 1 020

I had a look at Selenium for a few hours, but I am unable to get the things done I am looking for. It seems that I am not able to identify any link, css or whatever with regular expression (I always get errors that the locator I am looking for is not found).

`<td>verifyText</td>

<td>regexp:.*clicking.*</td> <td></td> ` is not found on this page for example.

Even if I would be able to let Selenium click a certain link for me, how would I automate it for all the links the fulfill my requirements? It seems that only the first match for a certain target specification is found by Selenium!? – Harald – 2015-08-18T15:00:05.170

1

Just for the record, I have achieved what I wanted. I had to use the sideflow plugin for Selenium IDE to be able to use while loops in my code.

Unfortunately, I never got the code to run when targeting a css code with the click command. Instead, I had to use something like

<tr>
<td>click</td>
<td>xpath=(//img[@alt='clickme'])[${indexvalue}]</td>
<td></td>
</tr>

where ${indexvalue} is the value of the index in my while-loop. Hope this helps!

Harald

Posted 2015-08-18T12:17:14.493

Reputation: 25