bangali_beta 11 Posted January 15, 2017 Report Share Posted January 15, 2017 (edited) Hi,The $Replace being a big fat pain. Looking at the attached small script you'll understand.In the "Keywords" UI, type your chosen keyword.In the "Promotional Url" UI, type your website url.In the "Comment" Box, copy & paste the following:Website: <PROMOTIONAL URL>Channel Sub: <CHANNEL SUBSCRIBERS NUMBER>Video Views: <VIDEO VIEWS NUMBER>Video Likes: <VIDEO LIKES NUMBER>Video Dislikes:<VIDEO DISLIKES NUMBER>Run the script and see what happens! Are you experiencing the list %videos views numbers containing the word "view" when it should have been replaced by now ? And, notice the screen shot saved on your desktop. Do you see the comment box containing any comment in the screen shot? No! well, it should since the code is set to comment. The unbuggy code: View Videos()define View Videos { divider set(#videos comment,$replace(#videos comment,"<KEYWORDS>",#keywords),"Global") set(#videos comment,$replace(#videos comment,"<PROMOTIONAL URL>",#promotional url),"Global") divider set(#current position on list_sers or videos,0,"Global") clear list(%channels subscribers numbers) clear list(%videos views numbers) clear list(%videos likes numbers) clear list(%videos dislikes numbers) navigate("https://www.youtube.com/watch?v=xJJ8qgK9Kvo","Wait") wait for element(<class="yt-subscription-button-subscriber-count-branded-horizontal yt-short-subscriber-count">,"","Appear") wait for element(<class="watch-view-count">,"","Appear") wait for element($element offset(<class="yt-uix-button-content">,14),"","Appear") wait for element($element offset(<class="yt-uix-button-content">,17),"","Appear") set(#current video channel subscribers number,$nothing,"Global") if($exists(<class="yt-subscription-button-subscriber-count-branded-horizontal yt-short-subscriber-count">)) { then { set(#current video channel subscribers number,$scrape attribute(<class="yt-subscription-button-subscriber-count-branded-horizontal yt-short-subscriber-count">,"innertext"),"Global") divider } else { set(#current video channel subscribers number,"N/A","Global") divider } } add item to list(%channels subscribers numbers,#current video channel subscribers number,"Don\'t Delete","Global") divider set(#current video views number,$nothing,"Global") if($exists(<outerhtml=w"<div class=\"watch-view-count\">*views</div>">)) { then { set(#current video views number,$scrape attribute(<outerhtml=w"<div class=\"watch-view-count\">*views</div>">,"innertext"),"Global") set(#current video views number,$replace(#current video views number,"views",$nothing),"Global") divider } else { set(#current video views number,"N/A","Global") divider } } add item to list(%videos views numbers,#current video views number,"Don\'t Delete","Global") divider set(#current video likes,$nothing,"Global") if($exists($element offset(<class="yt-uix-button-content">,14))) { then { set(#current video likes,$scrape attribute($element offset(<class="yt-uix-button-content">,14),"innertext"),"Global") divider } else { set(#current video likes,"N/A","Global") divider } } add item to list(%videos likes numbers,#current video likes,"Don\'t Delete","Global") divider set(#current video dislikes,$nothing,"Global") if($exists($element offset(<class="yt-uix-button-content">,17))) { then { set(#current video dislikes,$scrape attribute($element offset(<class="yt-uix-button-content">,17),"innertext"),"Global") divider } else { set(#current video dislikes,"N/A","Global") divider } } add item to list(%videos dislikes numbers,#current video dislikes,"Don\'t Delete","Global") divider} Edited January 16, 2017 by bangali_beta Quote Link to post Share on other sites
bangali_beta 11 Posted January 16, 2017 Author Report Share Posted January 16, 2017 (edited) Any luck anyone let me know. Thanks Edited January 16, 2017 by bangali_beta Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 17, 2017 Report Share Posted January 17, 2017 I suggest simplifying the code to pinpoint the issue.If something is wrong with the function then you can show it in far less lines of code. Also commenting your code would be helpful too. Regards,Nick 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.