jeudi 30 novembre 2017

Navigate a web page from node - No browser

Every day at work i need to pass a card at enter and at leave.
This action is log into a local web site.
Since im working as "Outsourcing" then at the end of the month i need to log in with user and password to the local site and copy paste every "In" and "Out" row to the "Outsourcing" company web site.

This is very annoying thing to do but it must be done or i didn't get paid...

So i want to smooth thing a little and this is what i did so far:

A: Log in to the local web site (Type user and password and press log in)

B: Run some script in Console. The script take the data from the grid (In and Out time and Date) And send the Array of data to a Node server.

C: On the server i create a new script to use in the outsourcing website company And send it to my email.

D: Then i open the outsourcing web page company, navigate to the relevant section.

E: Open console and paste the script that sent to my email and that's it. No dirty job.

But id' like to do it even more automatically, I'd like to have

A node service that run every few hours and get the data from the local web site and check it against some localDB, probably a sqlite.
If there is a new row then:

A: send the data to my email

B: At the end of the day, after "Leave" update the Outsourcing company web site with the new row - which is "In" and "Out" time.

I understand that there is a security issue, for example can i read a data from a web page, navigate and press button without opening browser?

I'd like to update the process to be more automatically and i'd like to hear your tips and suggestion.

Important note: I'm not trying to hack into something, i do have user and password for those site and i'm planning to use them in the process.

Thank you




Aucun commentaire:

Enregistrer un commentaire