Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72388

make chat spammer for youtube live chat in python

$
0
0

so hey!

i have started learning python like 5 hrs ago... i have to do some web automation with so i thought lets start by making a chat bot(it would be correct to call it spammer) for youtube live.

here's my code

import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:5655")

driver = webdriver.Chrome(options=chrome_options)

driver.get('https://www.youtube.com/watch?v=hHW1oY26kxQ')

time.sleep(20)

chatbox = driver.find_element_by_xpath('/html/body/yt-live-chat-app/div/yt-live-chat-renderer/iron-pages/div/div[1]/iron-pages/div[1]/yt-live-chat-message-input-renderer/div[1]/div[1]/div/yt-live-chat-text-input-field-renderer/div[1]')


chatbox.click()

i have just started so i dont know python very well

the problem i am stuck on is whenever i run this code it says element not found...

how can i solve this... my guess is the code is executing before the page is loading properly and start loading the live chat... howevever i m not totally sure... btw i tried putting sleep for more than a minute so it browser could load all pages but it still says element not found...

here's the desired process 1. open the browser 2. open the page 3. type the message that i will store in variable 4. send it

right now i m stuck at step 3... help me

btw i youtube live chatbox is weird i didnt found a input tag there yes it is a div


Viewing all articles
Browse latest Browse all 72388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>