To create a Lead with datas those are given in a WebPortal

Hlo Guys ,
I need a help to Insert a Document in a Doctype with datas those are given in a WebPortal. The Web portal is custom as it’s not using webforms.
I am using context and while printing “form_d” , I am able to fetch all the values given in field. I now want to use those datas to create a Lead in ERPNext. The code is as follows :


I am getting the datas that are filled in the custom page while printing “form_d”

. Can anyone help me to solve this? I want to use these datas to create a new Lead in ERP