My Journey To Learn Python / Selenium & Create Powerful IM Bots

THREAD UPDATE:

My mind is exploding with so many ideas for bots. I'm really enjoying creating these little automation scripts so far!

I have a feeling this is going to become very profitable once I start creating bots around all the methods I want to test.

This doesn't feel like I'm learning programming.. it feels like I'm building my IM arsenal.

739ei6qlS5CHrKzldFaLhA.png

My scripts are my weapons and my proxies are my soldiers. Traffic and money are the spoils of war.

xbY5sunETLqTQkZE_3AERA.png


I made a few more account creation scripts today.. here's one to CafeM0m if anyone wants it:

Code:
#IMPORT
from selenium import webdriver
driver = webdriver.Chrome(r"C:\Program Files (X86)\Google\chromedriver.exe")
from time import sleep

#SET VARIABLES
email = "[email protected]"
password = "zz123123ZzzA"
username = "Mom82z1"
firstname = "Brittney"
lastname = "Resson"
zipcode = 10470

#NAVIGATION
driver.get("http://www.cafem0m.com/profile/register.php") #FIX URL
driver.maximize_window()
sleep(2)

#FILL FIELDS
driver.find_element_by_id("firstname").send_keys(firstname)
driver.find_element_by_id("lastname").send_keys(lastname)
driver.find_element_by_id("email").send_keys(email)
driver.find_element_by_id("screen_name").send_keys(username)
driver.find_element_by_id("passwd").send_keys(password)
driver.find_element_by_id("zip").send_keys(zipcode)

#CLICK CHECKBOX
driver.find_element_by_id("optin").click()

#DROP DOWN SELECTION
driver.find_element_by_xpath("//select[@id='birthday_month']/option[@value='04']").click()
driver.find_element_by_xpath("//select[@name='birthday[Day]']/option[@value='8']").click()
driver.find_element_by_xpath("//select[@id='birthday_year']/option[@value='1986']").click()

sleep(5)

#SUBMIT FORM
driver.find_element_by_id("regSubmit").click()

I also made another script to log in, upload a profile picture, fill in account details like bio etc.

Unfortunately CafeM0m it doesn't require email validation so I haven't got into creating that script yet.

I'm going to work on setting that up now as well as the proxy code. I just got access to my private proxies.
 
THREAD UPDATE:

(IMAP) Email link clicker script...

When you create an account at a web 2.0 property and it sends a validation email, this script will find and click it for you automagically:
  1. Connects to your Gmail account (or whatever alternative) through IMAP
  2. Scans for the latest unread email in your inbox
  3. Strips useless text
  4. Finds the link
  5. Can navigate to the link etc
*Remember if you're using gmail you must go to account settings and allow insecure apps, otherwise it will throw an error.
Code:
#IMPORT
import imaplib
import re

#CONNECT VIA IMAP
mail = imaplib.IMAP4_SSL('imap.gmail.com','993')
mail.login('[email protected]', 'yourpass123')
mail.list() #List of folders / labels in gmail
mail.select("inbox") #Connect to inbox
result, data = mail.search(None, "ALL")

ids = data[0] #Data is a list
id_list = ids.split() #ids is a space separated string
latest_email_id = id_list[-1] #get the latest email

result, data = mail.fetch(latest_email_id, "(RFC822)") #fetch the email body (RFC822) for the given ID

raw_email = data[0][1] #here's the body, which is raw text of the whole email
utf_string = raw_email.decode('utf-8') #convert to UTF-8

zzztest = re.search("(?P<url>https?://[^\s]+)", utf_string).group("url")

print(zzztest)
 
Hi , first of all good luck on the journey i think im going to follow you and try it too since i already develop some things on java or other languages but want to explore more in depth python.
seccond i think you should stop using sleep since from my point of view it could generate errors in the future , i see that you use the sleeps to wait for the website to load but if you use for example sleep(2) and for you it loads maybe for someone with slower intenert it may not load on time wich will break the entire program for him.
in selenium i use things like isdisplayed "is_displayed()" in python so for example you will have something like this

driver.get("login website")
while(not driver.find_element("element that you want first for example login box").is_displayed()):
sleep(1)
continue the program

with that way the program will wait all the time that the person needs to load the login box so it won cause problems , also you can add time limits so after a certain amount of waiting it launch an exception and you can catch it like an error and display something like " error loading the website pls check your internet connection"

i hope that helps you , i will be reading your journey dont give up!
 
Hi , first of all good luck on the journey i think im going to follow you and try it too since i already develop some things on java or other languages but want to explore more in depth python.
seccond i think you should stop using sleep since from my point of view it could generate errors in the future , i see that you use the sleeps to wait for the website to load but if you use for example sleep(2) and for you it loads maybe for someone with slower intenert it may not load on time wich will break the entire program for him.
in selenium i use things like isdisplayed "is_displayed()" in python so for example you will have something like this

driver.get("login website")
while(not driver.find_element("element that you want first for example login box").is_displayed()):
sleep(1)
continue the program

with that way the program will wait all the time that the person needs to load the login box so it won cause problems , also you can add time limits so after a certain amount of waiting it launch an exception and you can catch it like an error and display something like " error loading the website pls check your internet connection"

i hope that helps you , i will be reading your journey dont give up!

That's very interesting and was something I was thinking about but for a different reason.
The page would take ~2 seconds to load but the elements I need (login box) would be there within 10ms.

Could this be used in reverse to avoid waiting for the whole page?
 
Hi. First thank u for this journey and more important for sharing ur code and tips I was really surprised and happy to see such one on the same time I ve started learning abt py+selenium. There's useful information here that a beginner need to start learning making bots.
I have a question though: i saw that u made a bot for accounts creation, why not making one for gmail or is it more complex ?
 
That's very interesting and was something I was thinking about but for a different reason.
The page would take ~2 seconds to load but the elements I need (login box) would be there within 10ms.

Could this be used in reverse to avoid waiting for the whole page?
this can be used for anything you want so you interact with it as long as its avaliable
its like
while ( element i want isnt displayed) wait a little
do something with it
that means that as log as you can interact with it you do it you dont have to wait for all the images to load for example wich will make your program faster

for example lets say the name box takes 1 sec to load and the submit button takes 2 secconds you can do this
while ( name box isnt displayed ) wait 1Mili sec
name box.write(name)
while(submit button isnt displayed) wait 1Milisec
submit button.click

wich will finish interacting in this page as fast as you can
 
Will wait for the success of this one. I've been pushing myself to learn python, but was slacking. Good luck!
 
Thread Update:

There's an issue with the proxies I ordered (requires IP validation in the control panel and I'm not sure how to set that up with 2captcha).

I'm waiting on a response ticket, should have everything in order soon.

I spent a few hours compiling a list of target sites / platforms / methods to use etc. I think running multiple methods on multiple targets is the best option, that way I can get the most value out of my proxies.

I have some private scripts in mind that I will be making but I don't plan to share.. however I also want to make some public ones available right away.

I think my first publicly released bot will be some kind of PM bot.

Example:

Join niche forum (automate account creation)
Scrape a huge list of recently active usernames (minus moderators, admin, super high post count members etc)
Boost up account with 5-15 posts (manual posting or outsource it)
Season accounts for a few days (let them sit)
Send PMs to forum users
Get traffic to LP
Profit

For me it's not so much about PM volume I'll be focusing on sending very high-quality, persuasive messages. I'm not 100% sure what forum type I'll be targeting yet.

This first bot will need to have almost all the most important features:
  • captcha solving
  • scraping abilities
  • auto-validate link in email
  • proxy rotation
  • user agent rotation
  • file to list
  • list to file
  • list manipulation commands
  • clear all cookies / traceable data
  • search for webpage elements
  • generate random numbers within a range
  • comparison statements
  • generate random name and address
  • generate profile pic
I'll release it heavily commented so any beginners can pretty easily understand what's going on.. and also it makes it fast to find and pull out a code snippet when you need it.

The idea isn't that I make a script you profit off as is.. You take the script and modify the code to target another platform, switch up the method a bit etc.

Hi , first of all good luck on the journey i think im going to follow you and try it too since i already develop some things on java or other languages but want to explore more in depth python.
seccond i think you should stop using sleep since from my point of view it could generate errors in the future , i see that you use the sleeps to wait for the website to load but if you use for example sleep(2) and for you it loads maybe for someone with slower intenert it may not load on time wich will break the entire program for him.
in selenium i use things like isdisplayed "is_displayed()" in python so for example you will have something like this

driver.get("login website")
while(not driver.find_element("element that you want first for example login box").is_displayed()):
sleep(1)
continue the program

with that way the program will wait all the time that the person needs to load the login box so it won cause problems , also you can add time limits so after a certain amount of waiting it launch an exception and you can catch it like an error and display something like " error loading the website pls check your internet connection"

i hope that helps you , i will be reading your journey dont give up!

Thanks, I appreciate you sharing the code! Doing it that way makes a lot more sense. Good point!

Hi. First thank u for this journey and more important for sharing ur code and tips I was really surprised and happy to see such one on the same time I ve started learning abt py+selenium. There's useful information here that a beginner need to start learning making bots.
I have a question though: i saw that u made a bot for accounts creation, why not making one for gmail or is it more complex ?

NP my friend, thanks for leaving a comment! It helps makes my journey more interesting and fun :)

I don't think Gmail account creation is that hard.. I probably won't be using them though. For long-term I'd rather use an alternative like Zoho / Outlook. The email link validation script works on any email provider that gives access to IMAP. I'll share the email creation bot as soon as it's ready to go!
 
Last edited:
Wow, this is awesome. You are very inspiring apex. The way you're moving, in a couple months if I need a pro bot software, I will know who to PM :)
 
Wow this is a really interesting journey. Very inspiring to see you create useful stuff . You seem to learn pretty fast I bet if you find the right niche and create a bot you can make a lot of money ;). I wish you lots of success mate!
 
Thread Update:
I think my first publicly released bot will be some kind of PM bot.

Example:

Join niche forum (automate account creation)
Scrape a huge list of recently active usernames (minus moderators, admin, super high post count members etc)
Boost up account with 5-15 posts (manual posting or outsource it)
Season accounts for a few days (let them sit)
Send PMs to forum users
Get traffic to LP
Profit

Just thought I'd drop in to mention that there's a tool Xrumer that already does this and has been doing this for years. It's also currently undergoing a huge overhaul which is expected to be complete in early 2018. I'm not sure if you're aware of it or familiar with it's problems but it doesn't currently use browser emulation and fails quite frequently because of this limitation and that's the major part of this revamping. So my guess is that your open source tool will be able to achieve this method perhaps with a greater success ratio? I'm going to be watching for that tool. Subscribed.
 
Not much to report at the moment. Just wanted to give a quick update...

I started working on the bot, I'm almost finished all the planning, I'll start building it tonight.

As far as updates I'll post if I find some good tutorials, or to report when major sections of the bot are finished (progress updates etc).

Just thought I'd drop in to mention that there's a tool Xrumer that already does this and has been doing this for years. It's also currently undergoing a huge overhaul which is expected to be complete in early 2018. I'm not sure if you're aware of it or familiar with it's problems but it doesn't currently use browser emulation and fails quite frequently because of this limitation and that's the major part of this revamping. So my guess is that your open source tool will be able to achieve this method perhaps with a greater success ratio? I'm going to be watching for that tool. Subscribed.

I'm not all that familiar with Xrumer (just know the basics about it) but it seems ridiculously advanced.

It can handle many kinds of forum platforms and get through lots of different kinds of security measures isn't that right? I always wanted to try it out.

My script should work with a very high success rate (100%?), but that probably depends on the proxies you use etc. It's going to be based around one forum framework (vbulletin, phpbb, etc), and it will take modifications to work on each different forum.

Edit: It maybe possible to write code that will edit the script and save a new copy with updated targeting to try to hook into new forums with the exact same layout. If the layout is the same just the targeting IDs would need to be updated and some other minor things.
 
Last edited:
Not much to report at the moment. Just wanted to give a quick update...

I started working on the bot, I'm almost finished all the planning, I'll start building it tonight.

As far as updates I'll post if I find some good tutorials, or to report when major sections of the bot are finished (progress updates etc).



I'm not all that familiar with Xrumer (just know the basics about it) but it seems ridiculously advanced.

It can handle many kinds of forum platforms and get through lots of different kinds of security measures isn't that right? I always wanted to try it out.

My script should work with a very high success rate (100%?), but that probably depends on the proxies you use etc. It's going to be based around one forum framework (vbulletin, phpbb, etc), and it will take modifications to work on each different forum.

Edit: It maybe possible to write code that will edit the script and save a new copy with updated targeting to try to hook into new forums with the exact same layout. If the layout is the same just the targeting IDs would need to be updated and some other minor things.

for your forum bot to be able to work on different forums you can do diferent general methods and pass diferent attributes for each forum and on top of that you make something to detect what kind of forum it is
for example you make the method login like this
login(Name,pass,forumtype)
if(forumtype="oneforumtype"):
namexpath="xpath of the name box"
passxpath="xpath of the passbox"
submitbutton="xpath of the submit button"​
elif(forumtype="different forum")
namexpath="different forum"
...​
#and then you will continue with the method same for all the forums like
driver.find_elements........(namexpath).send_keys(name) #check for the name box and write it
driver.find_elements........(passxpath).send_keys(pass)
driver.find_elements........(submitbutton).click()
#same for password and submit button
then outside of that you will have a function to detect the type of forum so you will store it and send it to the other methods
for example some forums may not have a custom domain and will have something like forumname.wordpress.com or things like that , that may be an easy way to detect some kind of forums on some platforms
coding it that way your bot will work and it will be easy to update it with more forum types you could also have a class with all the atributes of a forum like

forumtype1{
loginnamexpath="the path to the login name box"
loginpassxpath="the path to the login pass box"
loginsubmitxpath="the path of the submit button of the login"
}​
and there you will store everything you need of each individual forum (btw i dont know how to make clases on python yet but if you are familiar with some object oriented language like java you will understand it)

 
You probably already know but thebot.net is a cool forum for bots.

I have been using python selenium since 1 month ago, I had experience making apps so it was an easier transition.

Projects so far:
A duolingo bot that levels up duolingo for me 24/7. My friends think I'm a great linguist, but rly it's the bot x)

Script that accepts a url and then scrapes Ahrefs and semrush for all its metrics. Outputs an excel sheet with link, traffic, page count, average words per page ratios etc. Easy to compare top sites in niche.


Bots are like creating a free low skill employee or having internet super powers. Sometimes in Ogads chat the rank#1 people post their $$ today and it's like $1500. I have a strong hunch it's because they made/bought a clever bot
 
Thread update:

It's possible the bot will be ready very soon. I'll be putting around 25+ hours into it (along with some other scripts) over the next 7 days.

I didn't really want to make a new journey thread for this so I'll just post it here. I'll be going through some extremely intense training over the next week to increase my non-cognitive skills. My intelligence has led me to arrogance, procrastination, short-cuts, laziness and mediocrity. I need to increase my non-cognitive skills and conscientiousness if I'm going to get to the next level:
  • Resilience
  • Fearlessness
  • Tenacity
  • Motivation
  • Perseverance
  • Willpower
  • Killer instinct (drive to finish)
  • Pain tolerance
  • Adaptability
  • Exertion of effort
  • etc
This schedule is inspired by US Navy Seal and Canadian JTF-2 elite combat training. It's significantly easier, but its by far the most brutal training program I've ever attempted. After the week is over I'll be creating a new schedule which is still challenging but more flexible, less time consuming and less brutal.

Here's how the schedule looks (I'll probably make small changes in the first few days)

Hell Week (Sept 29th – Oct 6th)

Daily Schedule

4:00 AM: Wake up, open blinds, chug 1L of water & make bed
4:05 AM: Jog 14.5KM
6:00 AM: Tread water and swim in cold pool
6:15 AM: Bulletproof coffee + eat a healthy meal
7:00 AM: Walk dog wearing 55lbs backpack
7:30 AM: 300/300/300 [Pushups/Squats/Kneeups]
8:15 AM: Make a snack or energy drink
8:35 AM: Shower, shave, brush teeth, change into work clothes
9:00 AM: Clean room, wash dishes, take out trash etc
11:45 AM: Work on Python scripts
12:15 PM: Walk dog
12:40 PM: Eat healthy lunch, drink coffee
1:00 PM: Stretch, listen to music
6:00 PM: Website promotional work
6:50 PM: Power-lifting routine
7:00 PM: Cold shower
7:40 PM: Eat healthy meal
8:20 PM: Walk dog wearing 55lbs backpack
9:35 PM: Work on anything productive on my to-do list
9:40 PM: Prepare water, lay out clothing for tomorrow, brush teeth
9:55 PM: Visualizations
10:00 PM: Bed

Day 4 I'll be going without sleep and working through the entire night.

I won't be updating at all until the hell week is over. I'll be on complete social media blackout, no email, no forums, etc..

AAEAAQAAAAAAAAkvAAAAJGJjMjgwNzFiLTQ2NTMtNGNjMC04YzU2LTA0MWI4ZDJhODZlYw.jpg


lion-quotes-2.jpg
 
Back
Top