0

I am making my PET project that parse 3 jobs websites. I have 3 files with scripts that connected to my flask, now they parse only with static url. I want to user input the name of job so it can be converted to url and parse that url.

This is my function in flask:

@app.route('/rabota', methods=['GET', 'POST'])
def parsing_rabota():
    content = Parser_rabota(base_url_rabota=base_url_rabota, headers_rabota=headers_rabota)
    return render_template('rabota.html', content=content)

And this line of code in my script:

 base_url_rabota = 'https://example.com/zapros/python/%d0%ba%d0%b8%d0%b5%d0%b2/pg1'

    def Parser_rabota(base_url_rabota, headers_rabota):
        parse_time_start = time.time()
        jobs = []
        urls = []
        session = requests.Session()

...

It's just a small amount of my python script, it work properly now, but the main problem is to get input from user and then transfer it to my script or flask so it can run I can't get variables from my script into my flask app. How it can be realized?

Artem
  • 23
  • 4

1 Answers1

-1

Well, usually you get user input via form and POST. Does it answer your question?

janpeterka
  • 568
  • 4
  • 17