Jump to content



Photo

Wild Card In Search Page


  • Please log in to reply
9 replies to this topic

#1 clintk

clintk

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 94 posts
  • LocationDevon, United Kingdom
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 06:18 AM

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



#2 pash

pash

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3364 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 06:21 AM

try

https://wiki.ubotstu...m/wiki/Contains

navigate("http://www.ubotstudio.com/resources","Wait")
alert($contains($document text,"ubot"))

New Plugin:: Advanced Facebook | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint
- Advanced Data Text File | Advanced DateTime | Advanced Dialog | Advanced Document | Advanced Google Blogger V3 | Advanced Google Drive | Advanced Google YouTube V3 | Advanced Image | Advanced Video | Advanced Screen and Windows | Advanced Systems | Advanced Ubot 1 | Advanced Ubot 2 | Advanced WordPress | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint

- Advanced Captcha (V3) | Advanced Captcha (V2) (Old) | Create Table From Excel (Lite) | Check Conection | Ubot Enter License | Auto Free Memory
- Working hours GMT+7. i regret sometimes the answer is delayed due to health problems.


#3 clintk

clintk

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 94 posts
  • LocationDevon, United Kingdom
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 06:33 AM

Thanks, I'll have a look. :-)



#4 clintk

clintk

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 94 posts
  • LocationDevon, United Kingdom
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 06:47 AM

It was worth a try but that seems to only accept complete word and no wildcard :-(



#5 pash

pash

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3364 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 06:50 AM

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


New Plugin:: Advanced Facebook | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint
- Advanced Data Text File | Advanced DateTime | Advanced Dialog | Advanced Document | Advanced Google Blogger V3 | Advanced Google Drive | Advanced Google YouTube V3 | Advanced Image | Advanced Video | Advanced Screen and Windows | Advanced Systems | Advanced Ubot 1 | Advanced Ubot 2 | Advanced WordPress | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint

- Advanced Captcha (V3) | Advanced Captcha (V2) (Old) | Create Table From Excel (Lite) | Check Conection | Ubot Enter License | Auto Free Memory
- Working hours GMT+7. i regret sometimes the answer is delayed due to health problems.


#6 clintk

clintk

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 94 posts
  • LocationDevon, United Kingdom
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 07:08 AM

Brilliant! thanks Pash



#7 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3202 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 08:15 AM

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.



#8 clintk

clintk

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 94 posts
  • LocationDevon, United Kingdom
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 09:49 AM

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



#9 clintk

clintk

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 94 posts
  • LocationDevon, United Kingdom
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 09:58 AM

Ok, I got it!

Thanks for your help everyone !



#10 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3202 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 09 July 2019 - 01:20 PM

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}")
    }
}





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users