detect dynamic content

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

detect dynamic content

by akosididot on Sun Jun 19, 2016 9:23 pm

hi guys first of all i am terribly sorry i posted the wrong title i am not really sure what to write as i am really new to programming and this is my 1st time to try imacro before buying. I only want to accomplish a simple task that is to detect a certain content from a page. Sorry i dont know what terms to use maybe ill just explain it a bit more.

Pls bear with me here is an image of what the website script does and what i want to accomplish

Image

this is how the code on the website looks like

Code: Select all
<form action="#" method="get" id="form1">
 Guess the 1st letter of my name: <input type="text" name="gletter"><br>
</form>

<button type="submit" form="form1" value="Submit">Submit</button>

<div class="data-outcome item">
   <!-- ajax result -->
</div>


everytime you press submit a result will show inside <!-- ajax result --> and the code will be

Code: Select all
 <div class="inner-item">
   <div class="icon-correct">W<span></span></div>
</div>


if i guess it correctly and

Code: Select all
<div class="inner-item">
   <div class="icon-lose">L<span></span></div>
</div>


if i guess it wrong

so the code looks like this after every guess

Code: Select all
<div class="data-outcome item">
        <div class="inner-item">
            <div class="icn-win">W<span></span></div>
        </div>
</div>


i already have an imacro code that letting me guess automatically :D

Code: Select all
VERSION BUILD=11.1.495.5175
TAB T=1
TAB CLOSEALLOTHERS
SET !PLAYBACKDELAY 0.2

SET !VAR1 EVAL("var rDW35=Math.floor(Math.random()*3 + 1); rDW35;")
SET !VAR2 EVAL("var rDW310=Math.floor(Math.random()*5 + 1); rDW310;")
SET !VAR3 EVAL("var rDW57=Math.floor(Math.random()*5 + 3); rDW57;")
SET !VAR4 EVAL("var rDW515=Math.floor(Math.random()*6 + 5); rDW515;")
SET !VAR5 EVAL("var rDW515=Math.floor(Math.random()*120 + 1); rDW515;")

WAIT SECONDS={{!VAR5}}

'loop 1
TAG POS=2 TYPE=INPUT:TEXT ATTR=* CONTENT=A
WAIT SECONDS=1
TAG POS=1 TYPE=BUTTON:SUBMIT
WAIT SECONDS={{!VAR1}}

'loop 2
TAG POS=2 TYPE=INPUT:TEXT ATTR=* CONTENT=B
WAIT SECONDS=0.3
TAG POS=1 TYPE=BUTTON:SUBMIT
WAIT SECONDS={{!VAR1}}

'loop 3
TAG POS=2 TYPE=INPUT:TEXT ATTR=* CONTENT=C
WAIT SECONDS=0.3
TAG POS=1 TYPE=BUTTON:SUBMIT
WAIT SECONDS={{!VAR1}}


the code above allows me to guess 3 times actually, it can be 4 or 5 doesnt matter. What i want to do is detect the code if its a win or lose after i click the submit button, if i won and guess it correctly script will stop and go back from start and i lose script will continue until done.

i hope i have explained it well, simple tasks yet very hard for me to even explain it haha so you be the judge

thanks a lot in advance

Best Regards,
Dot
akosididot
 
Posts: 9
Joined: Sun Jun 19, 2016 8:51 pm

Re: detect dynamic content

by chivracq on Mon Jun 20, 2016 12:23 am

akosididot wrote:hi guys first of all i am terribly sorry i posted the wrong title i am not really sure what to write as i am really new to programming and this is my 1st time to try imacro before buying. I only want to accomplish a simple task that is to detect a certain content from a page. Sorry i dont know what terms to use maybe ill just explain it a bit more.

Pls bear with me here is an image of what the website script does and what i want to accomplish

Image

this is how the code on the website looks like

Code: Select all
<form action="#" method="get" id="form1">
 Guess the 1st letter of my name: <input type="text" name="gletter"><br>
</form>

<button type="submit" form="form1" value="Submit">Submit</button>

<div class="data-outcome item">
   <!-- ajax result -->
</div>


everytime you press submit a result will show inside <!-- ajax result --> and the code will be

Code: Select all
 <div class="inner-item">
   <div class="icon-correct">W<span></span></div>
</div>


if i guess it correctly and

Code: Select all
<div class="inner-item">
   <div class="icon-lose">L<span></span></div>
</div>


if i guess it wrong

so the code looks like this after every guess

Code: Select all
<div class="data-outcome item">
        <div class="inner-item">
            <div class="icn-win">W<span></span></div>
        </div>
</div>


i already have an imacro code that letting me guess automatically :D

Code: Select all
VERSION BUILD=11.1.495.5175
TAB T=1
TAB CLOSEALLOTHERS
SET !PLAYBACKDELAY 0.2

SET !VAR1 EVAL("var rDW35=Math.floor(Math.random()*3 + 1); rDW35;")
SET !VAR2 EVAL("var rDW310=Math.floor(Math.random()*5 + 1); rDW310;")
SET !VAR3 EVAL("var rDW57=Math.floor(Math.random()*5 + 3); rDW57;")
SET !VAR4 EVAL("var rDW515=Math.floor(Math.random()*6 + 5); rDW515;")
SET !VAR5 EVAL("var rDW515=Math.floor(Math.random()*120 + 1); rDW515;")

WAIT SECONDS={{!VAR5}}

'loop 1
TAG POS=2 TYPE=INPUT:TEXT ATTR=* CONTENT=A
WAIT SECONDS=1
TAG POS=1 TYPE=BUTTON:SUBMIT
WAIT SECONDS={{!VAR1}}

'loop 2
TAG POS=2 TYPE=INPUT:TEXT ATTR=* CONTENT=B
WAIT SECONDS=0.3
TAG POS=1 TYPE=BUTTON:SUBMIT
WAIT SECONDS={{!VAR1}}

'loop 3
TAG POS=2 TYPE=INPUT:TEXT ATTR=* CONTENT=C
WAIT SECONDS=0.3
TAG POS=1 TYPE=BUTTON:SUBMIT
WAIT SECONDS={{!VAR1}}


the code above allows me to guess 3 times actually, it can be 4 or 5 doesnt matter. What i want to do is detect the code if its a win or lose after i click the submit button, if i won and guess it correctly script will stop and go back from start and i lose script will continue until done.

i hope i have explained it well, simple tasks yet very hard for me to even explain it haha so you be the judge

thanks a lot in advance

Best Regards,
Dot

Thread Title is perfect, but FCIM (read my Sig, should be on top of your OP), even if I see some iMB11 further in your Post, but I stopped reading after the missing Commas for "If correct icon..." + "if wrong icon..." after I spent a few minutes trying to figure out what you were meaning...
Yep, sorry, just had another look, complete Punctuation is missing, sbd needs to read your Msg's 20 times before understanding exactly what you mean...
I like the Design though... I might give it another try tomorrow...

And hum, I would prefer the URL to the Original Page to have a look myself instead of some mini-HTML Source Code, I won't be reconstructing your Page from it...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6475
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: detect dynamic content

by akosididot on Mon Jun 20, 2016 1:15 am

Hi thanks for your reply, ok maybe i should read rules :D im doing it now

this is what i am using right now a free trial
iMacros Browser (x86) Version 11.1.495.5175
Released on 3/10/2016
Licensed Product: Trial Version
License Type: 30-day trial (29 days left)

as i want to make sure that it will work on my objective.

Actually the script is in localhost, have to upload it, its actually my script for my students a simple game so i made a drawing instead.

hope you can help me
akosididot
 
Posts: 9
Joined: Sun Jun 19, 2016 8:51 pm

Re: detect dynamic content

by Teckno on Tue Aug 16, 2016 11:30 am

akosididot wrote:Hi thanks for your reply, ok maybe i should read rules :D im doing it now
[emphasis added by Teckno]

this is what i am using right now a free trial
iMacros Browser (x86) Version 11.1.495.5175
Released on 3/10/2016
Licensed Product: Trial Version
License Type: 30-day trial (29 days left)

as i want to make sure that it will work on my objective.
[...]

Hi akosididot (Dot), looks like you didn't get a follow-up.

If I may suggest, please read again what chivracq asked for (re-read his Sig). Info you provided (quoted) is a start, but not everything. When we ask for free help... we shouldn't make others repeatedly ask us for things, or proofread our work.

Another suggestion: be specific and unambiguous in communicating. This is critical in technical area. In programs/scripts, a single character (e.g., a missing comma or extra letter) can change the entire meaning. Shame in English. ( :wink: :roll: : an extra letter changes the meaning). I agree with chivracq: a missing comma in your original post (text in your image) made it confusing. I also had guess what you meant. I hope I'm not being critical, am trying to get you to see how you need to help others help you.

Maybe you already solved this problem and don't need help anymore. If so... recognize that FREE support forums like these are for sharing. Also share your solutions, not just problems.

Best of luck.
Teckno
 
Posts: 1
Joined: Tue Aug 16, 2016 10:30 am

Re: detect dynamic content

by chivracq on Tue Aug 16, 2016 12:19 pm

akosididot wrote:Hi thanks for your reply, ok maybe i should read rules :D im doing it now

this is what i am using right now a free trial
Code: Select all
iMacros Browser (x86) Version 11.1.495.5175
Released on 3/10/2016
Licensed Product: Trial Version
License Type: 30-day trial (29 days left)


as i want to make sure that it will work on my objective.

Actually the script is in localhost, have to upload it, its actually my script for my students a simple game so i made a drawing instead.

hope you can help me

Teckno wrote:
akosididot wrote:Hi thanks for your reply, ok maybe i should read rules :D im doing it now
[emphasis added by Teckno]

this is what i am using right now a free trial
Code: Select all
iMacros Browser (x86) Version 11.1.495.5175
Released on 3/10/2016
Licensed Product: Trial Version
License Type: 30-day trial (29 days left)


as i want to make sure that it will work on my objective.
[...]

Hi akosididot (Dot), looks like you didn't get a follow-up.

If I may suggest, please read again what chivracq asked for (re-read his Sig). Info you provided (quoted) is a start, but not everything. When we ask for free help... we shouldn't make others repeatedly ask us for things, or proofread our work.

Another suggestion: be specific and unambiguous in communicating. This is critical in technical area. In programs/scripts, a single character (e.g., a missing comma or extra letter) can change the entire meaning. Shame in English. ( :wink: :roll: : an extra letter changes the meaning). I agree with chivracq: a missing comma in your original post (text in your image) made it confusing. I also had guess what you meant. I hope I'm not being critical, am trying to get you to see how you need to help others help you.

Maybe you already solved this problem and don't need help anymore. If so... recognize that FREE support forums like these are for sharing. Also share your solutions, not just problems.

Best of luck.

Ah-ah..., Thanks @Teckno for your (moral) Support, ah-ah...!

But hum, @OP was not doing too bad, they mentioned their FCI directly, even if OS is still missing..., I didn't follow up anymore on that Thread, I guess I was waiting for the Page to be uploaded to the Thread, which never happened, then other Threads came on and I forgot a bit about this Thread for which now 2 months later, @OP should have bumped a while ago or shared their Solution indeed if they managed to find a working Script....

For the "sick Fun", (@Teckno), you can have a look at this Thread where this (new) User is going a bit amok when I ask them to mention their FCI while he/she is supposed to be running 2 of the largest Technical Forums on Internet, euh...!? :shock:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6475
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: Google [Bot] and 3 guests

-->