Jump to content
UBot Underground

Wild Card In Search Page


Recommended Posts

Is it possible to use a wildcard in search page?

I saw this question was asked in 2010 and they were told it was on the todo list, surely it must have been done by now?

 

I do keep setting myself these tasks for no other reason other than learning Ubot but I won't stop until I find a way to achieve it. :-)

Here's what I want to do:-

 

Navigate to a web page.....simple

search the web page for a keyword...should be simple BUT

 

I want to return true if part of the word exists.

 

For instance, if the keyword was fox I want to return true if the word foxtail existed, basically I want to be able to use the keyword with wildcards such as *fox*

 

I won't ask can it be done because anything is possible, i will ask which of you highly intelligent people know how to do it.

I find flattery works well :-)

Looking forward to the suggestions because I've tried all day and cannot fathom it out!

Thanks,

Clint

Link to post
Share on other sites
navigate("http://www.ubotstudio.com/resources","Wait")
alert($comparison($find regular expression($document text,"UBot.*?Stealth"),"!= Does not equal",""))
 
 
 

 

  • Like 2
Link to post
Share on other sites

Contains should work, you don't need a wildcard.

 

For example:

set(#text,"HereIsSomeText","Global")
set(#contains,$contains($change text casing(#text,"Lower Case"),"some"),"Global")

Unless you wanted to control where it is in the word (such as start or end or middle for example) then you would need to use regex.

Link to post
Share on other sites

Contains should work, you don't need a wildcard.

 

For example:

set(#text,"HereIsSomeText","Global")
set(#contains,$contains($change text casing(#text,"Lower Case"),"some"),"Global")

Unless you wanted to control where it is in the word (such as start or end or middle for example) then you would need to use regex.

I still can't get that to work HelloInsomnia,

Could you possibly put it into a script for me that does this:-

 

navigates to a webpage

looks for a word that is inside another word eg, searches for sox when the word redsox exists and returns true.

If there isn't sox anywhere on the page return false.

 

It seems such a simple thing but I can't get my head around it.

TIA

Clint

Link to post
Share on other sites

Glad to hear you got it but I'll post an example anyways for those who find this thread later:

set(#textToSearchFor,"ant","Global")
comment("This archived page should always be the same")
navigate("https://web.archive.org/web/20190709075034/https://en.wikipedia.org/wiki/Coffee","Wait")
set(#textUnderPicture,$scrape attribute(<class="infobox hrecipe hproduct">,"innertext"),"Global")
if($contains($change text casing(#textUnderPicture,"Lower Case"),$change text casing(#textToSearchFor,"Lower Case"))) {
    then {
        alert("The page contains {#textToSearchFor}")
    }
    else {
        alert("The page DOES NOT contain {#textToSearchFor}")
    }
}
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...