Wanted - tool to automate public wifi site logons

I frequently go to a public wifi cafe site where they make you click a Connect button from your web browser to connect (no password). Even getting to that page requires clicking the “open network login page” that Firefox shows.

So I have to launch firefox, press the “Open network…” button, then press the “Connect” button in the next tab load served by the wifi cafe.

Is there a way to automate this in Fedora? Unfortunately the URL the Connect button results in is not fixed, but it changes everytime because they embed an IP address and other strings that change. If it was just fixed, I could bookmark that but it won’t work in this case.

First thought would be a small python script with the Requests module but failing that perhaps you could use ydotool or wtype to automate some of it.

Given that you probably want to have the browser open and running when you visit this café, I would imagine that manually starting the browser and letting some scripted automation executed in either of the two latter options would probably be most useful.

I’m more interested in something pre-made not writing a bunch of python code. So apparently the answer is “no”. Selenium can be scripted to do this but installing Selenium is way over kill for this simple thing. Maybe there’s a Firefox plugin that allows for one button running of a script that it makes.

Only one wifi site I go to is public, the others have a password so NetworkManager handles those for me. This one remaining site is extra annoying because they kick me off after a time so you have to do all the button presses again (the kick off timer is to discourage parking in the cafe too long)

I looked at the URL in detail the Connect button loads, I noticed the strings are really MAC addresses, not IPs. I don’t get what MACs they are because neither match the MAC on the wifi reported by “ip link”. Maybe it’s MAC randomization? I looked at “ip link” after leaving that place and rebooting elsewhere so maybe Fedora randomizes the MAC on the wifi.

So I’m going to go with them being fixed and just make the URL be a bookmark and see if that works (the “thecafe” is a fake string instead of the real business)

http://wifi.thecafe.com/accept?node_mac=e4:55:a8:93:a5:83&client_mac=46:bf:1f:3e:29:36&base_grant_url=https://na.network-auth.com/splash/zuDSrdG.0.744/grant

The only string I’m unsure about it changing is that string between “splash” and “grant”. It’s possible that’s changed every time so the bookmark would not work