Chezzyk 0 Posted November 12, 2016 Report Share Posted November 12, 2016 Hello, I'm trying to create scraper that will save me only url of pages that does not contain certain word. In my case it is word "day", problem is that $search page takes as possitive result also words that contains day, like "today" which I do not want. is there any way how to perform "exact search" with ubot? thanks for any help. Quote Link to post Share on other sites
deliter 203 Posted November 12, 2016 Report Share Posted November 12, 2016 define $containsURL(#search) { if($contains($url,#search)) { then { return("true") } else { return("false") } } } navigate("http://www.ubotstudio.com/resources","Wait") alert($containsURL("resources")) 1 Quote Link to post Share on other sites
Chezzyk 0 Posted November 14, 2016 Author Report Share Posted November 14, 2016 Hello, thanks a lot for help, but this does not seem to solve my problem. What I need to know is just how to perform "exact search", so when I'm searching for word "day" it only finds word "day" and not "today", "holiday" or "days" etc.. Quote Link to post Share on other sites
Chezzyk 0 Posted November 14, 2016 Author Report Share Posted November 14, 2016 this is how my script looks now, everything works except that one thing: ui text box("Total Loops:",#total loops) clear list(%neupdatovany) clear list(%updatovany) ui stat monitor("soucasna adresa",$url) ui stat monitor("Total Loops:",#total loops) ui stat monitor("Loop:",#count) set(#row,0,"Global") wait(2) ui open file("urls adresy",#adresa) create table from file(#adresa,&adresy) loop(#total loops) { clear cookies navigate($table cell(&adresy,#row,0),"Wait") wait for browser event("Page Loaded","") set(#soucasnadresa,$url,"Global") if($search page("day")) { then { add item to list(%updatovany,#soucasnadresa,"Don\'t Delete","Global") } else { add item to list(%neupdatovany,#soucasnadresa,"Don\'t Delete","Global") } } wait(1) increment(#row) } save to file("C:\\Users\\Administrator\\Desktop\\urls\\neupdatovanyurls.txt",%neupdatovany) save to file("C:\\Users\\Administrator\\Desktop\\urls\\updatovanyurls.txt",%updatovany) Quote Link to post Share on other sites
deliter 203 Posted November 14, 2016 Report Share Posted November 14, 2016 use find regular expression I am crap at regex but something like \bday\b \b is word boundary  word day Quote Link to post Share on other sites
Chezzyk 0 Posted November 16, 2016 Author Report Share Posted November 16, 2016 I still don't know how to solve this, I thought this will be the most easy part and I'm stuck on it for three days. I just dont know how to use find regular expression on page, I tried it with $URL, but it seems it searches only the actual URL address and not the whole page and I just don't know how to make it work on whole page. Quote Link to post Share on other sites
deliter 203 Posted November 16, 2016 Report Share Posted November 16, 2016 navigate("http://network.ubotstudio.com/forum/index.php/topic/20080-how-to-exact-search-with-search-page/#entry125530", "Wait") wait for browser event("Everything Loaded", "") alert("found {$find regular expression($document text, "\\bday\\b")}") You should be using document text rather then search page,with find regular expression Quote Link to post Share on other sites
Chezzyk 0 Posted November 16, 2016 Author Report Share Posted November 16, 2016 (edited) Ok I have solved it finally by taking different path and using $exists with wildcard, but thanks for your help at least I learned something about regex. Edited November 16, 2016 by Chezzyk Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.