2

I've got an HTML email form, and I want to be able to send myself an email with the form data. Here are my current problems:

How do I extract the data from the form once it's submitted and get it into Python? How do I link my Python script to my HTML page?

If those aren't possible, how would I extract the data from the form into some kind of file? If this is done in some other language like Javascript, that's fine, just please show how in your answer.

1 Answer 1

4

are you using Flask? It is hard to tell if you do not mention the web framework you are using.

I will assume that you are using Flask, here is how you can get the posted form input

subject = request.form.get('subject')
text = request.form.get('email')

Assuming you posted JSON instead, then you can get the data like this

data = request.get_json()

PS: Remember to set the content type to application/json when submitting the request.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm not using a web framework, I just want to be able to extract the data from the html form as some file that I can read in python

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.