Jump to content
UBot Underground

Scrape If Statement


Recommended Posts

Hi

 

 

I am trying to make a if statement, if scrape attribute equals >5 then pause, else continue.

 

I tried doing comparison but so far not working

 

 

if($comparison($scrape attribute(<id="numberblock_ournumber">,"innertext"),"> Greater than",5)) {
        then {
            pause script
        }
        else {
        }

    } 

Link to post
Share on other sites

I think you will need to post your code and the webpage you are using as that code works fine

 

from not reading your code/site you are using,maybe add a wait of a few seconds as that information mightn't be loaded when you try to scrape it

 

load html("<p id=\"numberblock_ournumber\">6</p>")
if($comparison($scrape attribute(<id="numberblock_ournumber">,"innertext"),"> Greater than",5)) {
    then {
        alert("greater than 5")
    }
    else {
        alert("<= 5")
    }
}

Link to post
Share on other sites

make a function that returns true

 

...

 

assuming the $scrape attrubute is getting something.

 

U5 sometimes has issues doing complex things in its conditionals.

 

so try the $scrape attrubute in a set command if you have not alrady.

 

Then try in a function.

 

if($scrape item()) {
    then {
        pause script
    }
    else {
    }
}
define $scrape item {
    return($comparison($scrape attribute(<id="numberblock_ournumber">,"innertext"),"> Greater than",5))
}
alert($scrape item())

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...