Sign in to follow this  
Followers 0
4b0082

Clicking Dynamic <div> Tags?

16 posts in this topic

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!

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

 

Maybe try

If StringInStr($oDiv.innertext, "0 of 1 clicks") Then

 

I can get the original part of that script to work (confirmed with checking $oDiv.innertext) but it won't click the link.

Edited by 4b0082

Share this post


Link to post
Share on other sites

So maybe this then

_IELinkClickByText($oIE, "0 of 1 clicks")

If this doesn't work, please provide the page link

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

"Bing Rewards isn't available yet in your country or region."

Sorry, I have no access to the source and can't guess where is the issue  chepa.gif

Share this post


Link to post
Share on other sites

4b0082,et al.,

It might be best to let a Mod weigh in on this...

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites

It does matter if it is in violation of the forum rules.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I'm unaware that it is, but If it's a violation of the forum rules, you shouldn't be posting in this thread.

Edited by 4b0082

Share this post


Link to post
Share on other sites

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0