Welcome folks today in this blog post we will be building a omegle bot
to increase website traffic automatically in flask. All the full source code of the application is shown below.
Get Started
In order to get started you need to install the selenium
library using the pip
command as shown below
pip install selenium
After installing this library you need to make an app.py
file and copy paste the following code`
app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from selenium import webdriver from time import sleep while True: driver = webdriver.Chrome("chromedriver.exe") driver.get("https://www.omegle.com") driver.maximize_window() sleep(2) loginbtn = driver.find_element_by_xpath("/html/body/div[3]/table/tbody/tr[2]/td[1]/div/div/div[1]/input") loginbtn.send_keys("youtube") cli = driver.find_element_by_xpath("/html/body/div[3]/table/tbody/tr[2]/td[2]/img") cli.click() sleep(2) lol = driver.find_element_by_xpath("/html/body/div[5]/div/div/div[2]/table/tbody/tr/td[2]/div/textarea") lol.send_keys("Want to learn coding fof free? Then check this out https://codingshiksha.com") sleep(2) zaz = driver.find_element_by_xpath("/html/body/div[5]/div/div/div[2]/table/tbody/tr/td[3]/div/button") zaz.click() sleep(3) driver.close() |
As you can see we are importing the selenium
library and then we are configuring the selenium chromedriver
path and then we are targeting the elements inside the browser using the xpath.
And then we are using sleep()
method. And then we are opening the omegle
website and this bot enters the interests automatically. And also it enters the static message automatically in the text box and then it clicks the send message button.