Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Fill Youtube Comment Text Box Using WB1

Guys please help me, i have this html code
PHP Code

<?php 
<div class="comment-simplebox-text" role="textbox" aria-multiline="true" contenteditable="true"> 

how do i fill that with text?

i've tried this code but its not working

PHP Code

<?php 
For Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("textbox")
            If 
element.GetAttribute("classname") = "comment-simplebox-text " Then
                element
.SetAttribute("value", "udin")
            
End If
        
Next 
Boop.. beep.. beep...
https://developers.google.com/youtube/2....l_comments
(Jan 21, 2016 07:24 PM)Jackie Chun Wrote:  https://developers.google.com/youtube/2....l_comments
i dont want to use api, but 2.0?
Boop.. beep.. beep...
I might be wrong, but I think the tag name is "div" not "textbox."
But even if I'm right, that seems way too easy for YouTube. I feel like they'd have something in place to prevent that.
(Jan 21, 2016 07:58 PM)Hawk HF Wrote:  I might be wrong, but I think the tag name is "div" not "textbox."
But even if I'm right, that seems way too easy for YouTube. I feel like they'd have something in place to prevent that.

It is a div, and nah there really isn't much they can do to prevent you from manipulating client side HTML elements.
You first need to open the box, I use the following javascript code:
Code
var innerHTMLs=[],elements=document.getElementsByTagName('div'),classToMatch='box';for(var i=0;i<elements.length;++i){if((' '+elements[i].className+' ').indexOf(' '+classToMatch+' ')!=-1){elements[i].click()}}

After that push the text with this:
Code
var innerHTMLs=[],elements=document.getElementsByTagName('div'),classToMatch='yt-simplebox-text';for(var i=0;i<elements.length;++i){if((' '+elements[i].className+' ').indexOf(' '+classToMatch+' ')!=-1){elements[i].innerHTML=elements[i].innerHTML+'%input%'}}

Replace %input% with your comment text.

Then enable with this:
Code
var innerHTMLs=[],elements=document.getElementsByTagName('button'),classToMatch='yt-uix-button yt-uix-button-size-default yt-uix-button-primary yt-simplebox-button yt-sb-post';for(var i=0;i<elements.length;++i){if((' '+elements[i].className+' ').indexOf(' '+classToMatch+' ')!=-1){elements[i].removeAttribute("disabled")}}

And press it with:
Code
var innerHTMLs=[],elements=document.getElementsByTagName('button'),classToMatch='yt-uix-button-content';for(var i=0;i<elements.length;++i){if((' '+elements[i].className+' ').indexOf(' '+classToMatch+' ')!=-1){elements[i].click()}}

It is updated to the current version of YouTube, so it should work properly.

Cheers,
But, why don"t you use httpwebreequest ? with namevaluecollection. It's esier than scrapping the whole age
Assert failure(PID 10704 [0x000029d0], Thread: 10960 [0x2ad0]): pBuffer != NULL


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by blackcoder00Jan 30, 2021 10:24 PM 9 255 Jan 30, 2021 10:24 PM
Last Post: saltycracker
[Python] by uzolSep 4, 2020 10:06 PM 4 204 Sep 4, 2020 10:06 PM
Last Post: uzol
[Shell] by Emre_Sep 2, 2019 07:07 PM 0 119 Sep 2, 2019 07:07 PM
Last Post: Emre_