Omegle Chat Bot Python/Selenium

  • Thread starter Thread starter Deleted member 938565
  • Start date Start date
D

Deleted member 938565

Guest
I'm just fiddling around with selenium atm tryna find something useful to do.

Couldn't find any working omegle script so fixed up some old one I found on github.

Without proxies or captcha support it's pretty crappy, and 9/10 users on omegle already seem to be bots so I'm looking for a different traffic source.

Anyways, in case anyone finds it interesting or wants to add...

Code:
from selenium import webdriver
from selenium.common.exceptions import InvalidElementStateException
from selenium.common.exceptions import UnexpectedAlertPresentException
import time,os





interest = input("Enter the interests seperate by a comma ")
msg1 = input("Enter your first message (1/4) >> ")
msg2 = input("Enter your second message (2/4) >> ")
msg3 = input("Enter your third message (3/4) >> ")
msg4 = input("Enter your fourth message (4/4) >> ")
driver = webdriver.Firefox()



def main():
      try:
            driver.get('http://www.omegle.com')
            time.sleep(2)
            driver.find_element_by_xpath('//textarea[@rows="3"]').clear()
            message = driver.find_element_by_xpath('//textarea[@rows="3"]')
            message.send_keys(msg1)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg2)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg3)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg4)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
      except (InvalidElementStateException, UnexpectedAlertPresentException):
            main2()
     
   
                         
   
def main2():
      try:
           
            driver.get('http://www.omegle.com')
            interest1 = driver.find_element_by_xpath('//input[@class="newtopicinput"]')
            interest1.send_keys(interest)
            btn = driver.find_element_by_id("textbtn")
            btn.click()
            time.sleep(5)
            driver.find_element_by_xpath('//textarea[@rows="3"]').clear()
            message = driver.find_element_by_xpath('//textarea[@rows="3"]')
            message.send_keys(msg1)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg2)
            send.click()
            message.send_keys(msg3)
            send.click()
            message.send_keys(msg4)
            send.click()
            send.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
           
      except (InvalidElementStateException,UnexpectedAlertPresentException) :
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
      else:
            main2()       
   
while True:
      try:
            main2()
      except (InvalidElementStateException,UnexpectedAlertPresentException) :
            main()
 
Shoot me a PM. i know how to make this work for u
He did get it to work, he says he fixed it and thats what he's dumping here
 
Last edited by a moderator:
Not related to this topic but nice pfp.

Good ol' osrs!
 
I'm just fiddling around with selenium atm tryna find something useful to do.

Couldn't find any working omegle script so fixed up some old one I found on github.

Without proxies or captcha support it's pretty crappy, and 9/10 users on omegle already seem to be bots so I'm looking for a different traffic source.

Anyways, in case anyone finds it interesting or wants to add...

Code:
from selenium import webdriver
from selenium.common.exceptions import InvalidElementStateException
from selenium.common.exceptions import UnexpectedAlertPresentException
import time,os





interest = input("Enter the interests seperate by a comma ")
msg1 = input("Enter your first message (1/4) >> ")
msg2 = input("Enter your second message (2/4) >> ")
msg3 = input("Enter your third message (3/4) >> ")
msg4 = input("Enter your fourth message (4/4) >> ")
driver = webdriver.Firefox()



def main():
      try:
            driver.get('http://www.omegle.com')
            time.sleep(2)
            driver.find_element_by_xpath('//textarea[@rows="3"]').clear()
            message = driver.find_element_by_xpath('//textarea[@rows="3"]')
            message.send_keys(msg1)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg2)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg3)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg4)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
      except (InvalidElementStateException, UnexpectedAlertPresentException):
            main2()
    
  
                        
  
def main2():
      try:
          
            driver.get('http://www.omegle.com')
            interest1 = driver.find_element_by_xpath('//input[@class="newtopicinput"]')
            interest1.send_keys(interest)
            btn = driver.find_element_by_id("textbtn")
            btn.click()
            time.sleep(5)
            driver.find_element_by_xpath('//textarea[@rows="3"]').clear()
            message = driver.find_element_by_xpath('//textarea[@rows="3"]')
            message.send_keys(msg1)
            send = driver.find_element_by_xpath('//button[@class="sendbtn"]')
            send.click()
            message.send_keys(msg2)
            send.click()
            message.send_keys(msg3)
            send.click()
            message.send_keys(msg4)
            send.click()
            send.click()
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
          
      except (InvalidElementStateException,UnexpectedAlertPresentException) :
            disconnect = driver.find_element_by_xpath('//button[@class="disconnectbtn"]')
            disconnect.click()
      else:
            main2()      
  
while True:
      try:
            main2()
      except (InvalidElementStateException,UnexpectedAlertPresentException) :
            main()
Can you tell me how to work with this?
 
You need download python 3, selenium, and geckodriver, then just run it and follow prompts

Works great, thank you.

There is one thing I want to talk about, do you guys get 20 captchas in a row when you first initialize the script? Then it lets you bot for a bit without hassle. Just curious.

Usually when i visit omegle as a human, the initial captchas are 1-4, not 20. So i might just visit it, solve the captcha, then let the bot run.
 
would like to add this, do you know why you get a connection error when you run multiple instances of this bot?
 
Back
Top