Jump to content

Where would I start if I want to write a script to scrape/change a setting on a local device that hosts a webpage Like my home router or smart device?

Catsrules

I don't really have a specific device or goal in mind at the moment but I was wondering how hard or easy is it to scrape information and change settings on a device that has the settings hosted on a local web server. I am not talking about any external other company web server as I am sure that might brake some TOS they have, But I am thinking small little devices that I own on my local network like Home routers, IP cameras, printers cheaper local smart sensors ect..

 

For example say I want my router to turn off WiFi via a script I can run on my desktop or other local computer on my network. I am guessing I just need a script to talk to the router login and pass it the variable to change WiFi Enable to WiFi disabled and simulate a click on the save/submit button?

 

Obviously it will be different for every device and it may not be possible on some devices like IP cameras if they have their own Java view interface or something more complicated. But for most of these devices it is just a plan http page with a little big of javascript. But I would like to know a good starting place I can start researching this topic.

 

 

Thanks.

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Honestly python, I believe the library is called selenium. It runs a web browser and does automated tasks. It can login and press buttons as well.

Link to comment
Share on other sites

Link to post
Share on other sites

Start by opening up the network tab in the Developer Tools in Firefox or Chrome. When you perform an action, you will see an HTTP POST request for the transaction. Once you have this, you can replicate the action via command line using a tool like curl. You will most likely have to set cookies and figure out a couple of other steps as well.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Ohsnaps said:

Honestly python, I believe the library is called selenium. It runs a web browser and does automated tasks. It can login and press buttons as well.

Thanks I will give that a look.

1 hour ago, badreg said:

Start by opening up the network tab in the Developer Tools in Firefox or Chrome. When you perform an action, you will see an HTTP POST request for the transaction. Once you have this, you can replicate the action via command line using a tool like curl. You will most likely have to set cookies and figure out a couple of other steps as well.

Ohh that is right I totaly forgot there was a network tab. I was looking at the source of the webpage in the developer mode but I didn't poke around in the network tab.

 

Thanks.

Link to comment
Share on other sites

Link to post
Share on other sites

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

×