Пример #1
0
def get_info():
    companyName = request.args.get("companyName")
    scrape = Scrape(companyName)
    number, driver = scrape.login()
    driver = scrape.select_company(driver, companyName)
    list = scrape.scrapy(driver)
    return jsonify(list)
Пример #2
0
def key_word():
    keyForm = KeyForm(request.form)
    companyForm = CompanyForm(request.form)
    key_word = None
    names = None
    company = None
    number = 0
    if keyForm.validate_on_submit():
        key_word = keyForm.key_word.data
        scrape = Scrape(key_word)
        number, driver = scrape.login()
        tags, names = scrape.get_company_list(driver)
    if companyForm.validate_on_submit():
        company = companyForm.company.data
        scrape = Scrape(company)
        number, driver = scrape.login()
        driver = scrape.select_company(driver, company)
        lists = scrape.scrapy(driver)
        return render_template('company.html', lists=lists)
    return render_template('index.html',
                           keyForm=keyForm,
                           companyForm=companyForm,
                           key_word=key_word,
                           names=names,
                           number=number,
                           company=company)