Method for generating public opinion report based on Selenium

文档序号:1363076 发布日期:2020-08-11 浏览:4次 中文

阅读说明:本技术 一种基于Selenium生成舆情报告的方法 (Method for generating public opinion report based on Selenium ) 是由 徐利东 远贵良 于 2020-04-16 设计创作,主要内容包括:本发明公开了一种基于Selenium生成舆情报告的方法,Selenium生成舆情报告的方法步骤如下:生成报告的模板、绘制页面、信息存储、二次编辑、数据更新、报告预览、报告下载。本发明的关键点:将Selenium作为报告生成的核心技术;报告结构化数据和非结构化数据独立存储的架构体系;支持可视化二次在线编辑;支持实时预览和导出。(The invention discloses a method for generating a public opinion report based on Selenium, which comprises the following steps: generating a report template, drawing a page, storing information, editing for the second time, updating data, previewing the report and downloading the report. The key points of the invention are as follows: selenium is used as a core technology for report generation; an architecture that reports independent storage of structured data and unstructured data; visual secondary online editing is supported; real-time preview and export is supported.)

1. A method for generating a public opinion report based on Selenium is characterized in that the method for generating the public opinion report by Selenium comprises the following steps:

step 1: generating a template for the report: calling a browser through a Selenium, and giving a template url for generating a report;

step 2: drawing a page: dynamically loading data by the browser and drawing an html page;

and step 3: information storage: sending the generated chart information to a server and storing the chart information to a file server; sending the static code block of the page to a server and storing the static code block to an hdfs server;

and 4, step 4: and (4) secondary editing: loading code blocks and picture resources to redraw the page, and providing a secondary editing function;

and 5: and (3) updating data: after the second editing is finished, updating the related data to the mysql server;

step 6: and (4) report preview: directly requesting data from a background and dynamically loading a rendering page;

and 7: report downloading: and mapping the background data through fields and exporting the background data into a text format.

2. The method of claim 1, wherein the method comprises: the browser for generating the report template is a Google browser.

3. The method of claim 1, wherein the method comprises: the page is drawn by dynamically loading data through the ajax technology.

4. The method of claim 1, wherein the method comprises: the text format in the report downloading is word format.

Technical Field

The invention relates to the technical field of computer networks, in particular to a method for generating a public opinion report based on Selenium.

Background

In recent years, with the rapid development of the internet, network media have been deeply introduced into people's daily life as a new information dissemination form. The network public opinion is active to an unprecedented extent, and no matter domestic or international important events, the network public opinion can be formed immediately, and the viewpoint and the spreading thought can be expressed through the network, so that great public opinion pressure is generated, and the method reaches the step that any department and organization cannot ignore. It can be said that the internet has become an amplifier of the decentralization of ideological and cultural information and social public opinion.

The internet public sentiment has the characteristics of directness, burst, quick transmission, richness, interactivity, strong linkage and the like, so that the social public sentiment dynamic is mastered in time according to the reasons of interest, and the public sentiment trend is mastered in time. The public opinion brief report is an important means and an effective tool for public opinion analysis and processing, and is a result report which makes full use of the content and data of a public opinion acquisition system and quickly generates various character, data, diagram analysis and the like through model analysis and content customization. Through the information basis that public opinion briefs provided, government, enterprise will in time master the public opinion trend, and the accurate early warning information of catching is favorable to discovering fast, rapid processing to the important incident of great influence to reach quick, high-efficient positive guide public opinion and propaganda, construct the purpose of positive mainstream public opinion.

At present, the main implementation mode is a method for reporting public sentiment according to a static template, and the mode is relatively simple, cannot meet the condition that the report content temporarily changes, and sometimes needs secondary editing; the assistance given to the work is limited and the efficiency and aesthetic degree are not high.

Disclosure of Invention

The invention aims to solve the technical problems that the automatically generated report does not support on-line editing and the report is not beautiful; the method calls a Google browser through a Selenium frame and loads real-time data page information; repeatedly confirming whether loading is completed or not through an event button in a circulating way; then, storing the data and the static code block in the webpage into hdfs through a front-end ajax technology; meanwhile, the preview and online editing of the browser are supported; by this technique, reports can be saved as words at the same time. The core problems that public opinion reports cannot be edited online and report styles are not attractive when the public opinion reports are generated online are solved.

In order to solve the technical problems, the invention adopts the following technical means:

a method for generating a public opinion report based on Selenium comprises the following steps:

step 1: generating a template for the report: calling a browser through a Selenium, and giving a template url for generating a report;

step 2: drawing a page: dynamically loading data by the browser and drawing an html page;

and step 3: information storage: sending the generated chart information to a server and storing the chart information to a file server; sending the static code block of the page to a server and storing the static code block to an hdfs server;

and 4, step 4: and (4) secondary editing: loading code blocks and picture resources to redraw the page, and providing a secondary editing function;

and 5: and (3) updating data: after the second editing is finished, updating the related data to the mysql server;

step 6: and (4) report preview: directly requesting data from a background and dynamically loading a rendering page;

and 7: report downloading: and mapping the background data through fields and exporting the background data into a text format.

Preferably, the further technical scheme of the invention is as follows:

the browser for generating the report template is a Google browser.

The page is drawn by dynamically loading data through the ajax technology.

The text format in the report downloading is word format.

The invention achieves the following technical effects: the problem that the automatically generated public opinion report is not beautiful is solved; the problem of instability of a large-scale public opinion report is solved; the framework of independent storage of report information and file information is adopted, and permanent storage of massive reports is supported; dynamic preview and download of reports is supported.

Drawings

FIG. 1 is a block diagram of the present invention.

Detailed Description

The present invention will be further described with reference to the following examples.

Referring to fig. 1, the method for generating a public opinion report based on Selenium according to the present invention includes the following steps:

step 1: generating a template for the report: calling a browser through a Selenium, and giving a template url for generating a report; the browser for generating the report template is a Google browser.

Step 2: drawing a page: dynamically loading data by the browser and drawing an html page; the page is drawn by dynamically loading data through the ajax technology.

And step 3: information storage: sending the generated chart information to a server and storing the chart information to a file server; sending the static code block of the page to a server and storing the static code block to an hdfs server;

and 4, step 4: and (4) secondary editing: loading code blocks and picture resources to redraw the page, and providing a secondary editing function;

and 5: and (3) updating data: after the second editing is finished, updating the related data to the mysql server;

step 6: and (4) report preview: directly requesting data from a background and dynamically loading a rendering page;

and 7: report downloading: and mapping the background data through fields and exporting the background data into a text format. The text format in the report downloading is word format.

The key points of the invention are as follows: selenium is used as a core technology for report generation; an architecture that reports independent storage of structured data and unstructured data; visual secondary online editing is supported; real-time preview and export is supported.

Since the above description is only a specific embodiment of the present invention, but the protection of the present invention is not limited thereto, any equivalent changes or substitutions of the technical features of the present invention which can be conceived by those skilled in the art are included in the protection scope of the present invention.

5页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种数据处理方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!