Ask coding questions

← Back to all posts
Making a robot
PYer (3922)

I am looking for some way to have a bot go to certain sites, and input text. I think one way would be to access the id's and classes and set a value to them. I don't really know. I want it to be so for example, I could create a bot with a repl.it account, that comments, and creates repls. I am kind of imagining something like this.

import siterobot
robot = siterobot.Robot()
robot.site('https://repl.it/')
robot.enter('ID of username element here', 'fullern000')
robot.enter('ID of password element here', 'qwertyuiop1')
robot.enter('ID of submit element here', True)

Now the bot has logged into my repl.it account.

The password is fake. Don't even try it.

Answered by mat1 (4381) [earned 5 cycles]
View Answer
Comments
hotnewtop
mat1 (4381)

You could try ActiveSoup

from activesoup import driver

d = driver.Driver()
login_page = d.get('https://repl.it/login')
login_form = login_page.form
login_data = login_form.submit({'username':'mat1',
'password':'qwertyuiop1'})
print(login_data.json)

Please upvote my comment if it was helpful or useful in any way. Thank you! :^)

PYer (3922)

@mat1 Thanks! I will try it

mat1 (4381)

Btw, for the record, you aren't allowed to make a bot that comments on other peoples posts.

DrankArizonaIce (132)

@mat1 how do we know you’re not a bot commenting on this post? ,:0