Automating weekly SD card formatting of a camera

I have a camera, with an SD card that fills up in about 8 days.
It does not have a function to overwrite the oldest recordings, so if the SD card is full, it stops recording.
Every week, I manually need to erase the SD card via the WebGUI of the camera.
Is there a possibility to automate this in some way ?

To clear the SD card, I need to login to the camera, go to this settings page in a browser, and click on the link to format the SD card, a popup appears to ask if I am sure, and there I need to click on OK.

I looked around in HA docs, and found an integration called scrape.
Would it be possible to format the camera SD card using scrape ?
As I am not a web developer, I will need some help on how to do this.

In the browser, I saved the page to html, and found this.

<a href="" onclick="" style=""><script type="">document.write(str_sdfat32);</script>Format SD Card as fat32</a>
&nbsp;<a href="#" onclick="do_formatsd()" style="color:#6633FF"><script type="text/javascript">document.write(str_sdfat32);</script>Format SD Card as fat32</a>
&nbsp;#do_formatsd()color:#6633FFtext/javascript

and also found a js function that seems to do the formatting

`function do_formatsd()`

`{`

`var s = document.getElementById("form_submit");`

`if (confirm(str_ask_sdfat32) == true)`

`{`

`s.action = "cgi-bin/hi3510/sdfrmt.cgi";`

`s.submit();`

`}`

`else`

`{`

`return false;`

`}`

`}`

When I click on the format SD link, a popup appears to ask if I am sure, and if I then click OK, the camera formats the SD card.
I guess this is the command to format the SD card s.action = "cgi-bin/hi3510/sdfrmt.cgi";

I suppose the yaml config should look a bit like this, but as I am not familiar with html or javascript, I will need someone to help me to get this working correctly.

scrape:
  - name: camera
  - resource: (http://192.168.0.34/web/admin.html)
    authentication: basic
    username: ‘username’
    password: password
    method: post
    payload: "cgi-bin/hi3510/sdfrmt.cgi"
    scan_interval: 604800