Jump to content

Clicking Dynamic <div> Tags?


 Share

Recommended Posts

I'm having trouble figuring out how to code this script, can anyone help me figure this out?

  1. Load the webpage (sample.com).
  2. Search for "<div>0 of 1 clicks</div>" and if it exists, click it.
  3. Refresh the page, search again.
  4. If "0 of 1 clicks" isn't found, exit the loop and continue the rest of the script.
#include <IE.au3>

$oIE = _IECreate("http://sample.com")

$oDivs = _IETagNameGetCollection($oIE, "div")
For $oDiv in $oDivs
    If $oDiv.innertext = "0 of 1 clicks" Then
        _IEAction($oDiv, "click")
        ExitLoop
    EndIf
Next

I can't even get this script to click the div tag, so I'm not sure what I'm doing wrong.

The <a> tag surrounding the <div> is dynamically changing each time the page refreshes.

Would love some guidance, thanks!

Link to comment
Share on other sites

  • Developers

Okay, http://www.bing.com/rewards/dashboard - I'm trying to get my script to automatically click and cycle through everything that says "0 of 1 credit". _IELinkClickByText doesn't work even though the text is embedded in a link. What causes it to be unable to click the text?

care to explain the purpose of all of this?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

care to explain the purpose of all of this?

Just trying to learn my way around AutoIt by challenging myself with some simple scripts. Bing was something I figured I'd give a shot for learning IE.au3.

Edited by 4b0082
Link to comment
Share on other sites

  • Developers

Just trying to learn my way around AutoIt by challenging myself with some simple scripts. Bing was something I figured I'd give a shot for learning IE.au3.

you are avoiding my question.

What is the purpose of this script?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I don't understand the question? It just cycles through unclicked "0 of 1 credit" links on that page and clicks them until they're all clicked. When one of the links is clicked it's turned into a check mark and "0 of 1 credit" disappears. The purpose is to click all of the unclicked links.

Link to comment
Share on other sites

I'm not familiar with Bing rewards. How does this script benefit you?

It doesn't really, either way I have to click those links if I want to get a credit. I'm just trying to automate it because I wanted to see if I could do it as a challenge to myself.

Bing is Microsoft's search engine, they give you points for up to 30 searches a day and a few other daily activities. Eventually you can exchange them for coupons and stuff, nothing special.

Thread is getting derailed. I still just want to know how to get my script working..

Link to comment
Share on other sites

  • Moderators

4b0082,

 

I have to click those links if I want to get a credit. I'm just trying to automate it

We do not help automate "click for reward" sites - thread locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...