Ask coding questions

← Back to all posts
WHen someone follows me, i this bot messages them and asks them why they followed me.
upsideumop (6)

I don't know how to do this with selenium. Can someone show me how? the follower pg is here:

Answered by OldWizard209 (1528) [earned 5 cycles]
View Answer
OldWizard209 (1528)

umm, you will need a chrome driver for this if you are using chrome. If you are not, then i think u should use chrome. Next, you will need to see the HTML code of the page where you see your followers, and then see the tags in which the followers' names are contained, and then iterate over all names and send them a message, again by seeing where the messages are contained. Lastly, you will need Selenium to click all the buttons, like send message etc.. (You can do that by using the find by css elemnt thingy).

I didnt really look into the website you attached so I hope this helps..

EDIT: Took a look and here is the followers' name tag:

upsideumop (6)

@OldWizard209 THanks! but that is not what i really need. what i want is when someone follows me, i sed them a message that asks why they followed me, not messaging old followers. im sorry for not explaining well.

OldWizard209 (1528)

UMMM. This is pretty easy to solve. You can create a list of all of your followers and then make an if statement that if someone is not on the list, send him a message, and add him to the list. Something that would go like

list_of_followers = [# get this list(I assume you know how to...)]

new_followers = [# create another list of new followers that]

for user in new_followers:
    if user not in list_of_followers:
        send_message() # function that sends messages.

Hope this helps. I could actually make the code that even shows the selenium and send you, but I am sorry I don't have time for that as I am busy with school exams for the next 3 weeks. But, I hope this helpsanyways :) !!!


OldWizard209 (1528)

oh sure i could. but like I said, I m busy with a lot of schoolwork although I am active on replit. I have exams this Thursday till beginning of May. So my schedule sucks with little to no time for coding. But, if you can show me what you have tried, I can help you. I can add you to a team and we can work on it if I have time. Sounds good? @upsideumop

upsideumop (6)

oh its fine. i dont want to bother you. i was asking codingcactus so you didnt have [email protected]

OldWizard209 (1528)

Bruh sorry lol. I didn’t read the ping. I thought you were referring me. But seeing that you are relatively new to replit, the rules say that it is not a good idea to ping people in discussions they are not involved in especially mods. So I would recommend you that pls don’t ping mods and pretty much anyone. @upsideumop

upsideumop (6)

@OldWizard209 oh ok sorry. you dont have to help (you already did) you seem busy. i will def credit you tho! you really helped out the {REDACTED} yr old noob!