django 1 Posted June 5, 2014 Report Share Posted June 5, 2014 Hi i am testing ubot and facing one problem I made a variable like #abc and value is set to "http://yoursite.com/abc" If variable #abc set to http://yoursite.com/abc then bot scrap 3/470469and if variable #abc set to https://www.abcdef.com then bot scrap 1/2017354and so on possible ? Quote Link to post Share on other sites
Marton 48 Posted June 5, 2014 Report Share Posted June 5, 2014 Something like this? if($comparison(#abc, "=", "http://yoursite.com/abc")) { then { set(#scraped_value, $find regular expression($document text, "(?<=//pause/).*?(?=\\\\)"), "Global") } else if($comparison(#abc, "=", "https://www.abcdef.com")) { set(#scraped_value, $plugin function("File Management.dll", "$Find Regex First", $document text, "(?<=my_sites/pause/).*?(?=\\\\)"), "Global") } } I used the $Find Regex First function from Aymen's File Management Plugin for the second one because there are two very similar tables in your html (it's just easier that way). Let me know if this helps. Marton 1 Quote Link to post Share on other sites
django 1 Posted June 6, 2014 Author Report Share Posted June 6, 2014 thx urban.marton for quick help. But what if we have lots of data and #abc variable fill by users ? means #abc variable can be anything. Quote Link to post Share on other sites
Marton 48 Posted June 6, 2014 Report Share Posted June 6, 2014 thx urban.marton for quick help. But what if we have lots of data and #abc variable fill by users ? means #abc variable can be anything. Never mind, I just got what you meant. I'll take a look at it for you later today. Quote Link to post Share on other sites
Marton 48 Posted June 6, 2014 Report Share Posted June 6, 2014 That's what I could come up with: set(#scraped_value, $trim($find regular expression($find regular expression($document text, "(?s)(?<=my_sites/delete/).*?(?=\\\\.*{#url})"), ".*\\Z")), "Global") Works for all three URLs in your html. I also attached the code I was playing with (no plugins needed).test.ubot 1 Quote Link to post Share on other sites
django 1 Posted June 6, 2014 Author Report Share Posted June 6, 2014 That's what I could come up with: set(#scraped_value, $trim($find regular expression($find regular expression($document text, "(?s)(?<=my_sites/delete/).*?(?=\\\\.*{#url})"), ".*\\Z")), "Global") Works for all three URLs in your html. I also attached the code I was playing with (no plugins needed). great its working fine but however its messed up with more data but now i know how it will work thx for help :-) Quote Link to post Share on other sites
Marton 48 Posted June 6, 2014 Report Share Posted June 6, 2014 great its working fine but however its messed up with more data but now i know how it will work thx for help :-) Hi, I'm glad! Are you using Ubot4 though? I had clean results with it (although I don't know why $trim was necessary, it shouldn't be needed, I guess it's a Ubot thing...) Let me know if you need any changes. Quote Link to post Share on other sites
django 1 Posted June 7, 2014 Author Report Share Posted June 7, 2014 Hi, I'm glad! Are you using Ubot4 though? I had clean results with it (although I don't know why $trim was necessary, it shouldn't be needed, I guess it's a Ubot thing...) Let me know if you need any changes. i am using ubot 5 ubot works like a charm if you know logic :-) Quote Link to post Share on other sites
Marton 48 Posted June 7, 2014 Report Share Posted June 7, 2014 i am using ubot 5 ubot works like a charm if you know logic :-) I've been testing the code in Ubot 4, that's why I was asking. It gave me clean results in Ubot4, Ubot 5 still does some strange stuff, I wouldn't go even near it yet. Quote Link to post Share on other sites
Marton 48 Posted June 8, 2014 Report Share Posted June 8, 2014 Hey-hey, I just had a similar problem today, and I realized there is a much-much simpler solution for this problem. I attached the updated code for you. It works with full URLs, but even part URLs as you can see in this short video: http://www.screencast.com/t/MIfA3gg6J3 Hope it helps,Martontest_updated.ubot 1 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.