I need to process a lot of elements (pictures) within an active tab of Opera, one by one as follows.

Once an URL is open, there are about 10-20 elements (pictures sliding from right to left) to process.

First I need to view code of an element#1 (that is picture#1) to find out whether it has characters/lines/numbers I want; manually I would do it by pressing Ctrl+Shift+C in Opera to invoke the tab "Elements" appearing on the right part of the screen and go into it.

Then I need to search through a ton of HTML elements for a line which in a short version looks like this:

> "<li class="popup-slider-list-item popup-slider-list-item-#NNN"
> data-image="https:addressofpicture1.jpg" style="background-image:
> url(&quot;https://anotheraddressofpicture.jpg&quot;);"><span
> class="popup-slider-list-item-fade tr-opacity-03"></span><span
> class="popup-slider-list-item">{myVotes}</span><span
> class="popup-slider-list-item"></span></li>"

(it is all one line, ">" should be removed). My observation is that the part I need for each picture is within ""

If I find a certain characters/numbers/words within the above mess (sorry, elements) I should process the picture, otherwise I skip to element#2 (picture#2), etc..

I started off my script like this:

for i in {1..3000}
# I expect up to 3000 pictures to process

    opera -activetab https://url#1
    # this is the first problem - 
    # I need Opera browser to open an URL within CURRENT active tab,
    # not a new one, but "-activetab" still opens a new tab for my kubuntu

    # here should be my script.  


Please guide me in the right direction - which commands do I need?

(I am starting to read up about xdotool - would that be enough?).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.