Jump to content

Python filling <form>s and clicking buttons

Guest

Just for fun I want to make a script that opens a webbrowser (visible or not doesn't matter) that goes to kahoot.it and enters the game by entering the game pin, clicking the join button, then filling in a nickname and clicking another submit button. I don't even know where to start. I tried messing with requests but despite my best effort I could only get a html file that said 'true', I had no idea what I was doing. So does anyone know where to start with this? I think it uses JS instead of http requests

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, mikat said:

 


$('#thebuttondivIDhere').click();

 

 

It's not my website and I want to do this in python

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, whitephoenix said:

It's not my website and I want to do this in python

you can run js after the page loaded, and no you can't modify a web page with python.

(you need JS)

you could try creating a user script and running it with something like greasemonkey on load of the page

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, mikat said:

you can run js after the page loaded, and no you can't modify a web page with python.

(you need JS)

That's cool, in that case I think I got it. Is there an easy way to run javascript scripts without typing it every time though?

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, fizzlesticks said:

Look into Selenium, it's used to automate browsers.

 

I used this myself for some web scraping for somebody a year or so ago. It's quite nice. Easy enough to pick up.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×