Hey Rmunro,
You have been awesome with the help you provided and many hours worth of watching youtube videos and reading on google. I have completed this bot. I am on the free edition and my understanding is that I can only have 2 bots. This bot was to make sure I could do anything I needed to which I can it just takes the right knowledge. I plan to delete this bot as I am fairly sure it will get my marked for spam if i officially activate it, Which could lead to being banned from youtube and I learn from youtube every day so do not want to lose that free resource of knowledge.
But I was in no way going to delete it before I could show the UI path community as hopefully someone else who wants to work with youtube content and can spark their imagination for what they are trying to do.
Time to start explaining
This bot was made for the purpose of Free marketing through a Commenting bot that would join youtube comments related to my content and say nice things to them and then leave a link ( links do not 100% Youtube has put a stop to links being put into Comments it will cause an error or at minimum make the content creator have to Approve your comment before it will be allowed to be viewed.)
- step in the process will involve getting the information that I want to work with into the bot
This is done with an INPUT DIALOG activity
It asks me What is my video about? - This is what goes into the Search field on youtube.
It also asks me What is the link to the video I am trying to promote, This would be the link to my Youtube video.
The 2. step is to Open a new browser, I preferred to use Firefox for this as I use Chrome more often for myself and wanted my Bot to be working on a different area for setup reasons, etc…etc…
During this, it will also use a Type into the field for the search field and will input my response from INPUT DIALOG. Then it will use a Click Image command for the Search button ( previously I was using an Element Click and it would bug out every so often even with delays put in place, after switching to clock Image I never had the problem again
Step 3. gets a bit more advanced, As it is going to Scroll the page using a condition in a WHILE activity the Condition is Scroll<25 When the scroll is less than 25 it may stop. I scroll the page using a SEND HOTKEY activity. you have 3 options here to scroll down - Use the Down arrow key, Use the Page down key - Use the End key
This is how they react
Down arrow - Minimal movement page will only move a tiny bit.
Page down - Will move a pretty good distance almost half a window down
End key - This will scroll your screen down as far as it can go.
I used the End key as it allowed me to constantly make the page larger so when I extracted data I had a large amount to extract.
The
Extracted Structure Data is an amazing Tool BUT it bugs out a bit on Firefox I had to do the initial setup of this Data Scrape from Chrome THEN switch the browser to Firefox within the activity. I am not sure why this is but it is what it is.
SEE Picture below for important NOTES from extraction
Step 4 will load my PREVIOUS sent Comments and put them into a data table. Why I do this is because the top page of search results for youtube typically have the same persons content. I did not want to blow up 1 person with my comments so every time it sends out a comment it will store this information back in the excel list and reference to it before it starts up again If the name exists in the Data table it will SKIP that scraped data and move to the next to see if that one has the same name and so on till it finds a new target.
Step 5 is where all the magic happens
It will first read the extracted data and put it into a temporary excel these get deleted every time you run the bot a new time. FOR EACH ROW in that Excel it will GET ROW ITEM twice one for Watch url on youtube and the other for the content creators name
It will repeat step 4 within the FOR EACH ROW this is there so that as the bot sends a comment it will check the NamesMaster excel file to make sure it has not just sent that person a comment.
It will then use an IF activity with the conditions that Commented already videos STRING contains the NAME string of the next target. This is done by turning my Master Names Data table to a long string to use in this condition. You would do this with an Output Data Table To see the Exact layout of the IF condition please check out the Snapshot as it will help to understand of how the code looks I am no programmer so this part took me a bit to get down.
Step 5.1
Add Data Row activity when the Condition is met in my IF activity what this does is it adds the Current scraped NAME as a string to the Data table that is currently holding the Master Commented already names. This is so that the name is added on its own.
right after this, it will use the Attached Browser that I’m currently in at this point and it will Navigate to “https://www.youtube.com/”+YTurlsSDT
YTurlsSDT is my string variable for the current scraped video I am on. I use a TRY CATCH activity
below this contained in the TRY area is a Do while activity the Condition is DidIFindtheCommentBox which will come back TRUE or FALSE depending on the Image exists which is looking for the Add a public comment…
The reason this is all in a Try catch command is that some people do not allow comments on there video when they do this the Image exists will never find the image because it is not there. Mainly this TRY CATCH works as skip over this one if you can’t find it. in the Type into activity once it finds and Clicks the Add a public comment… it uses this to write there a message
“Hey “+YTnamesDT+”,This is some serious “+Adjative +SearchFor+”. I really enjoyed this video, thought I would see if you would be willing to check out my video. “+VideoLink+” It is not the most fancy “+SearchFor+” video but I have more coming just curious how people like my play and tips are always appreciated as well! Mr. Joints”
This was designed to be a Spin text function definitely more complicated then it has to be but I did not want it sending multiple messages that are all the same with just the name changing.
Step 5.2
After all that it will Overwrite the Previous Master list names with the new Data table of Commented names. At this point, the data table contains all the same names as when previously opened and as well now it has the 1 additional name from whatever it just commented on.
Remember this is all in a FOR EACH ROW activity for the Scraped data. It will continue steps 5 - 5.2 until the Scraped data list is at the bottom.
That is pretty much to full bot. I currently did not have it send any comments because I would be building it but I would frequently test it to make sure it navigated correctly and typed into the comments correctly but it would skip hitting send till I was done with the building of the bot. Than after I finished it i decided I did not want to get banned for spamming, sooooo I’m not going to use it Either way it was really fun to build and it made me feel like I have a good understanding of how to build a UI Path that works with finicky websites like Youtube.
This Thread can now be closed as I no longer need help but I hope my post can help someone else out there!!
Thanks,
Mr. Joints