Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripted update of web page
#1
I am not a developer per se. I try to find a way to update our CMDB database using Python (scripted bulk updates) and I stuck in a way.

Here is what I have.
CMDB database running on MS SQL server has IIS web interface.
The web page, when I check it's source, is combination of HTML and JavaScript code.
The IIS web server has an API for reading the database and creating new CIs. Only two methods are implemented GET and POST. The POST written in a way that it only capable of creating of new CIs and attempt to feed it with data for existing CI returns error with the message that record is not unique.
All this is somewhat understandable.
The best (in my opinion) way to up update CIs is to code PATCH method in API, but the person who wrote the API does not work here anymore.

What I tried to do.
I wrote Python code that can read the database and create new CIs. All works through the API and works well.
But I cannot find a way to update the record.
On the other hand I have a fact that from the web browser I can update any record. Which means that task can be done.

Is my assumption right:
That submitted data, before being posted from the web browser, pre-processed by the JavaScript imbedded into the web page, and only then get sent to the web server for processing. This way it does not use API and update database directly.
How I can use this to script my bulk update procedures?
Should I somehow intercept the page before it reaches the database (or the web server) and update it to my needs?
I do not quite understand how to form a Post request and how to send it to the web server bypassing the API.
I also noticed that each request uses some kind of unique key in communication with the server. I guess, it makes communication between browser and web server uncompromisable. Which also means that I, with my python interference, will not be able to enter the data I need. Unless I try to use some Python libraries that are capable of generating such unique key (or request it from the server) and use it in communication with the server.
I need some examples of such code, but I do not know how to ask questions about it.
Reply


Messages In This Thread
Scripted update of web page - by treatitwell - Jan-05-2018, 09:07 PM
RE: Scripted update of web page - by wavic - Jan-06-2018, 12:16 AM
RE: Scripted update of web page - by treatitwell - Jan-06-2018, 01:27 AM
RE: Scripted update of web page - by treatitwell - Jan-06-2018, 03:06 AM
RE: Scripted update of web page - by wavic - Jan-06-2018, 03:16 AM
RE: Scripted update of web page - by treatitwell - Jan-06-2018, 03:19 AM
RE: Scripted update of web page - by snippsat - Jan-06-2018, 02:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 3,715 Mar-19-2020, 06:13 PM
Last Post: apollo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020