CN111859072A - Automatic form declaration and score query method and system for intranet - Google Patents
Automatic form declaration and score query method and system for intranet Download PDFInfo
- Publication number
- CN111859072A CN111859072A CN202010710279.8A CN202010710279A CN111859072A CN 111859072 A CN111859072 A CN 111859072A CN 202010710279 A CN202010710279 A CN 202010710279A CN 111859072 A CN111859072 A CN 111859072A
- Authority
- CN
- China
- Prior art keywords
- information
- intranet
- access
- learner
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 238000012360 testing method Methods 0.000 claims abstract description 54
- 230000009193 crawling Effects 0.000 claims abstract description 7
- 230000003068 static effect Effects 0.000 claims description 33
- 230000004044 response Effects 0.000 claims description 27
- 238000004891 communication Methods 0.000 claims description 21
- 230000007246 mechanism Effects 0.000 claims description 20
- 235000014510 cooky Nutrition 0.000 claims description 16
- 230000009191 jumping Effects 0.000 claims description 2
- 235000014347 soups Nutrition 0.000 description 7
- 239000000284 extract Substances 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/951—Indexing; Web crawling techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9566—URL specific, e.g. using aliases, detecting broken or misspelled links
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Transfer Between Computers (AREA)
- Electrically Operated Instructional Devices (AREA)
Abstract
The invention discloses an intranet-oriented automatic form declaration and result query method and system, wherein the automatic form declaration method comprises the following steps: inputting intranet login information of all the learners and configuring a crawler rule; traversing the intranet login information of all the learners, logging in a server according to the intranet login information of a single learner, and then crawling the answer of the test paper and submitting the answer to the server; judging whether the traversal is finished, if so, finishing and quitting, and if not, continuing the traversal; the achievement inquiring method comprises the following steps: inputting intranet login information of all the learners and configuring a crawler rule; traversing the intranet login information of all the learners, logging in a server according to the intranet login information of a single learner, and then crawling webpage information and analyzing to obtain the examination score of the learner; and judging whether the traversal is finished, if so, finishing and exiting, and if not, continuing the traversal. The invention can automatically submit the answer of the test paper in a form and simultaneously quickly inquire the score.
Description
Technical Field
The invention relates to the technical field of data mining, in particular to an intranet-oriented automatic form declaration and result query method and system.
Background
The examination systems based on the network are very many, and examination questions are difficult without auxiliary data learning, so a form submission method is needed, accurate examination information is quickly provided for the examinees, and the examinees can conveniently learn.
In Python, the url llib module integrates multiple functions of web page interaction. The Beautiful Soup module can analyze webpage content, extract effective information and realize form submission and simulated login through Python crawlers, but the prior art is not deployed according to the actual conditions of an intranet, and login accounts and login passwords need to be matched on site.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: aiming at the technical problems in the prior art, the invention provides a form automatic declaration and score query method and system specially oriented to an intranet, which can automatically submit the answer of a test paper in a form and quickly query the score.
In order to solve the technical problems, the technical scheme provided by the invention is as follows:
an intranet-oriented automatic form declaration method comprises the following steps:
A1) acquiring intranet login information of all the learners and configuring a crawler rule;
A2) the method comprises the following steps of selecting the intranet login information of a learner to log in a server, crawling the answer of a test paper and submitting the answer to the server, wherein the method specifically comprises the following steps:
A21) Defining a MyHTTPDAO class by utilizing a Python internal urllib library, initializing an HTTP communication class by the MyHTTPDAO class to establish a basic communication protocol with a server, and finishing a communication session for keeping the cookie by utilizing an opener mechanism;
A22) taking account number and password information in the login information of the intranet of the learner as access parameters, constructing an http entry address post _ url _ login for logging in the intranet as an access address, and logging in a server according to a crawler rule;
A23) constructing a static address url _ myCenter for acquiring personal information as an access address, determining an access parameter according to cookie information stored by an opener mechanism, acquiring webpage information according to a crawler rule, and extracting the personal login name of a learner in response parameters;
A24) constructing a static address post _ url _ getExam for acquiring personal examination records as an access address, taking row and column information and page information as access parameters, acquiring webpage information according to a crawler rule, extracting examination information of a learner in the last week, and storing the examination information in an examination library;
A25) constructing a static address post _ url _ UserExam used for confirming taking of an examination as an access address, acquiring examination paper id of a last week of a learner from an examination library, taking the examination paper id and flag information of the last week of the learner as access parameters, acquiring webpage information according to a crawler rule, and entering step A26 if the value of a response parameter is a preset first identifier), otherwise, skipping to step A210);
A26) Constructing a static address url _ goExam used for acquiring the test paper number of the learner as an access address, taking the examination test paper id of the last week of the learner as an access parameter, acquiring webpage information according to a crawler rule, extracting the personal examination information of the learner, and finding the test paper number of the learner by adopting a regular expression;
A27) constructing a static address post _ url _ showExam used for acquiring test paper information as an access address, taking the number of the test paper of a learner as an access parameter, acquiring webpage information according to a crawler rule, extracting test paper answers, constructing a list containing the test paper answers, and constructing a dictionary containing the finally combined test paper information according to the list;
A28) constructing a static address post _ url _ checksumitexam for confirming the submission of the test paper information as an access address, taking the test paper id of the last week of the learner as an access parameter, acquiring webpage information according to a crawler rule, and entering the step A29 if the value of a response parameter is a preset second identifier), otherwise, skipping to the step A210);
A29) constructing a static address post _ url _ submituExam used for submitting test paper information as an access address, and sending the dictionary to the address post _ url _ submituExam;
A210) Constructing a static address post _ url _ logout for logging out as an access address, taking null information as an access parameter, submitting the null information to a server according to a crawler rule, and logging out;
A3) and D, judging whether the intranet login information of all the learners is traversed or not, if so, ending and exiting, and otherwise, returning to the step A2).
Further, the crawler rule specifically includes:
s1) inputting an access address and an access parameter;
s2) creating an HTTP access request object as a mechanism for accessing the server;
s3) judging whether the access parameter is empty, if so, accessing the server by a get method, otherwise, accessing the server by a post method;
s4) decoding the response parameter returned by the server.
The invention also provides an intranet-oriented score query method, which comprises the following steps:
B1) acquiring intranet login information of all the learners and configuring a crawler rule;
B2) the method comprises the following steps of selecting an intranet login information of a learner to log in a server, and then crawling an examination score of the learner, wherein the method specifically comprises the following steps:
B21) defining a MyHTTPDAO class by utilizing a Python internal urllib library, initializing an HTTP communication class by the MyHTTPDAO class to establish a basic communication protocol with a server, and finishing a communication session for keeping the cookie by utilizing an opener mechanism;
B22) Taking account number and password information in the login information of the intranet of the learner as access parameters, constructing an http entry address post _ url _ login for logging in the intranet as an access address, and logging in a server according to a crawler rule;
B23) constructing a static address url _ myCenter for acquiring personal information as an access address, storing cookie information by using an opener mechanism to determine whether an access parameter is empty, accessing a server by using a corresponding method, acquiring webpage information according to a crawler rule, and extracting the personal login name of a learner in response parameters;
B24) constructing a static address post _ url _ findMyResults used for inquiring personal examination results as an access address, taking row information and column information and page information as access parameters, acquiring webpage information according to a crawler rule, and extracting the examination results of the last week of a learner;
B25) constructing a static address post _ url _ logout for logging out as an access address, taking null information as an access parameter, submitting the null information to a server according to a crawler rule, and logging out;
B3) and (4) judging whether the intranet login information of all the learners is traversed or not, if so, ending and exiting, and otherwise, returning to the step B2).
Further, the crawler rule specifically includes:
S1) inputting an access address and an access parameter;
s2) creating an HTTP access request object as a mechanism for accessing the server;
s3) judging whether the access parameter is empty, if so, accessing the server by a get method, otherwise, accessing the server by a post method;
s4) decoding the response parameter returned by the server.
The invention also provides an intranet-oriented automatic form declaration and result query system, which comprises computer equipment, wherein the computer equipment is programmed or configured to realize the intranet-oriented automatic form declaration method, the intranet-oriented result query method, the intranet-oriented automatic form declaration method or the intranet-oriented result query method.
Compared with the prior art, the invention has the advantages that:
the invention is based on the crawler method, can automatically log in the intranet and analyze the webpage content, realizes automatic extraction of the test paper answers and submission to the server, and meanwhile, quickly inquires the score, thereby saving a large amount of time for operators.
Drawings
Fig. 1 is a flowchart of a method for automatically declaring a form according to an embodiment of the present invention.
FIG. 2 is a flow chart of crawler rules in an embodiment of the present invention.
FIG. 3 is a flowchart illustrating answer submission for test paper in an embodiment of the present invention.
FIG. 4 is a flowchart of initializing an HTTP communication class according to an embodiment of the present invention.
FIG. 5 is a flowchart of a result query method according to an embodiment of the present invention.
FIG. 6 is a flowchart illustrating a score query process according to an embodiment of the present invention.
Detailed Description
The invention is further described below with reference to the drawings and specific preferred embodiments of the description, without thereby limiting the scope of protection of the invention.
As shown in fig. 1, the automatic declaration method of the form oriented to the intranet of the present invention includes the following steps:
A1) acquiring intranet login information of all the learners and configuring a crawler rule;
A2) selecting the intranet login information of a learner to log in a server, and then crawling the answer of the test paper and submitting the answer to the server;
A3) and D, judging whether the intranet login information of all the learners is traversed or not, if so, ending and exiting, and otherwise, returning to the step A2).
As shown in fig. 2, the crawler rule adopted in this embodiment is a myrlli method, which specifically includes:
s1), inputting an access address and an access parameter, where the access address is an address of a server disposed at the cloud end and is a fixed http address, and the access parameter is a parameter transmitted in a dictionary form;
S2) creating an HTTP access request object as a mechanism for accessing the server;
s3) judging whether the access parameter is empty, if so, accessing the server by a get method, otherwise, accessing the server by a post method;
s4) decoding the response parameter returned by the server.
As shown in fig. 3, the specific steps of step a 2) in this embodiment include:
A21) defining a MyHTTPDAO class by utilizing a Python internal urllib library, initializing an HTTP communication class by the MyHTTPDAO class to establish a basic communication protocol with a server, and finishing a communication session for keeping the cookie by utilizing an opener mechanism;
A22) taking idcard and email information in intranet login information of a learner as access parameters, wherein idcard refers to id information or an account number, and email refers to email information or a password, constructing an http (hyper text transport protocol) entry address post _ url _ login used for logging in an intranet as an access address, and logging in a server according to a crawler rule, namely a myurllib method;
A23) constructing a static address url _ myCenter for acquiring personal information as an access address, determining an access parameter according to cookie information stored by an opener mechanism, acquiring webpage information according to a crawler rule, namely a myurllib method, and extracting a personal login name of a learner in a response parameter by using a Beautiful Soup module, wherein the personal login name is 'div', class _ = 'name l' returned by a server in the embodiment;
After obtaining the personal login name of the learner, judge whether the learner can take an examination, in this embodiment, the basis of judging whether the learner can take an examination is whether the examination information of the learner in the last week exists, so the examination information of the learner in the last week is extracted at first, and the specific steps include:
A24) constructing a static address post _ url _ getExam used for acquiring personal examination records as an access address, taking rows and page information as access parameters, wherein the rows refer to row and column information, the page refers to page information, acquiring webpage information according to a crawler rule, namely a myurllib method, extracting examination information of a last week of a learner in response parameters and storing the examination information into an examination library, in the embodiment, a server returns a character string containing a dictionary, extracts and stores ditct _ zhou [ 'rows' ] [0] into a ditzezhou, and after translation by using a Beautiful Soup module, the ditzezhou [ 'rows' ] [0] represents the information of the last week of the learner, and the ditect _ lastzhou represents the information of the last week of the examination library;
in step a 24) of this embodiment, if the examination information of the last week of the learner in the extracted response parameter is null, it indicates that the learner has not taken the examination in the intranet in the last week, and cannot take the examination, and if the examination information of the last week of the learner in the extracted response parameter is not null, it indicates that the learner has taken the examination in the intranet in the last week, and can take the examination, and the specific steps of this embodiment, which are directed to how to confirm that the learner can take the examination, include:
A25) Constructing a static address post _ url _ UserExam for confirming taking of an examination as an access address, acquiring examination paper id of a last week of a learner from an examination library, taking the examination paper id and flag information of the last week of the learner as access parameters, acquiring webpage information according to a crawler rule, namely a myurllib method, if the value of a response parameter is a preset first identifier, entering step 2.6), and otherwise, jumping to step A210), wherein in the embodiment, the value of the examination paper son id of the last week of the learner is the examination paper id corresponding to the examination library extracted from the jformat data, the statement is di _ lastzhou [ 'uuid' ], and the flag represents whether the examination can be taken or not, in the embodiment, if the learner does not take a study and an examination of an intranet in the last week, the examination information of the last week of the learner is empty, so the examination paper id of the last week of the learner in the examination library does not exist, if the response parameter with the value of the preset first identifier cannot be obtained, the response parameter indicates that the examination cannot be taken, the logging-in is directly quitted, if the learner takes part in the learning and examination of the intranet in the last week, and the examination information of the learner in the last week is not null, so that the examination paper id of the learner in the last week in the examination library can be obtained, the response parameter with the value of the preset first identifier can be obtained, the next step is carried out, meanwhile, in the embodiment, the first identifier defined by the server code is-10, namely, if the response parameter value returned by the server is-10, the examination can be taken, otherwise, the logging-in is directly quitted;
A26) For a learner who can take an examination, acquiring the test paper number of the learner, constructing a static address url _ goExam used for acquiring the test paper number of the learner as an access address, wherein url _ goExam is one of necessary access addresses of the method in the embodiment, taking the examination test paper id of the learner in the latest week as an access parameter, acquiring webpage information according to a crawler rule, namely a myurllib method, extracting the personal examination information of the learner by using a Beautiful Soup module, and finding the number sjId of the test paper of the learner by using a regular expression;
A27) acquiring test paper information after acquiring the test paper number of a learner, constructing a static address post _ url _ showExam used for acquiring the test paper information as an access address, taking the number sjId of the test paper of the learner as an access parameter, acquiring webpage information according to a crawler rule, namely a myurllib method, extracting test paper answers by using a Beautiful Soup module, constructing a list _ muao containing the test paper answers according to the extracted test paper answers, constructing a dictionary form _ data _ submiteExam according to the constructed list, wherein the dictionary form _ data _ submiteExam contains the test paper answers in a finally combined list _ muiao as the test paper information;
A28) After obtaining the test paper information, confirming whether the test paper information can be submitted or not, constructing a static address post _ url _ checksumitexam for confirming the submission of the test paper information as an access address, taking the test paper id of the latest week of a learner as an access parameter, obtaining webpage information according to a crawler rule, namely a myellib method, entering a step A29 if the value of a response parameter is a preset second identifier, and otherwise, skipping to the step A210). in the embodiment, a second identifier defined by a server code is 0, if a response parameter value returned by the server, returndata [ 'STATUS' ] = =0, indicating that the test paper information can be submitted, and if the response parameter value is not 0, the test paper cannot be submitted, directly quitting login;
A29) after confirming that the test paper information can be submitted, constructing a static address post _ url _ submitExam for submitting the test paper information as an access address, sending a dictionary form _ data _ submitExam to the address post _ url _ submitExam of the server through a get method according to a crawler rule, namely a myurllib method, wherein the form _ data _ submitExam contains the test paper answer in the finally combined list _ mubiao as the test paper information, and sending the data to the address post _ url _ submitExam, namely completing the submission of the test paper information;
A210) And after the submission is finished, logging out of the learner, constructing a static address post _ url _ logout for logging out as an access address, submitting a request containing the get method to the server according to a crawler rule, namely the myurllib method by using the null information as an access parameter, and logging out.
As shown in fig. 4, the step of MyHTTPDAO initializing an HTTP communication class in step a 21) in this embodiment specifically includes: and constructing header information of a simulation browser, creating a Cookie Jar object, storing cookie information by using an opener mechanism, and keeping the dialogue information with a server.
As shown in fig. 5, the present invention further provides an intranet-oriented score query method, which includes the following steps:
B1) inputting intranet login information of all the learners and configuring a crawler rule;
B2) the method comprises the steps that an intranet login information of a learner is selected to log in a server, and then an examination score of the learner is crawled;
B3) and (4) judging whether the intranet login information of all the learners is traversed or not, if so, ending and exiting, and otherwise, returning to the step B2).
In the method for querying a result for an intranet, the crawler rule is the same as that of the method for automatically declaring a form for an intranet, and the method specifically includes:
S1) inputting an access address and an access parameter;
s2) creating an HTTP access request object as a mechanism for accessing the server;
s3) judging whether the access parameter is empty, if so, accessing the server by a get method, otherwise, accessing the server by a post method;
s4) decoding the response parameter returned by the server.
As shown in fig. 6, the specific step of step B2) in this embodiment includes:
B21) defining a MyHTTPDAO class by utilizing a Python internal urllib library, initializing an HTTP communication class by the MyHTTPDAO class to establish a basic communication protocol with a server, and finishing a communication session for keeping the cookie by utilizing an opener mechanism;
B22) taking idcard and email information in intranet login information of a learner as access parameters, wherein idcard refers to id information or an account number, and email refers to email information or a password, constructing an http (hyper text transport protocol) entry address post _ url _ login used for logging in an intranet as an access address, and logging in a server according to a crawler rule, namely a myurllib method;
B23) constructing a static address url _ myCenter for acquiring personal information as an access address, determining an access parameter according to cookie information stored by an opener mechanism, acquiring webpage information according to a crawler rule, namely a myurllib method, and extracting a personal login name of a learner in a response parameter by using a Beautiful Soup module, wherein the personal login name is 'div', class _ = 'name l' returned by a server in the embodiment;
B24) Constructing a static address post _ url _ findMyResults for inquiring personal examination scores as an access address, wherein the post _ url _ findMyResults in the embodiment are addresses capable of inquiring the examination scores, line information and page information are used as access parameters, webpage information is obtained according to a crawler rule, and the examination scores of the learner in the last week are extracted by using a Beautiful Soup module;
B25) after the query is completed, logging out of the learner, constructing a static address post _ url _ logout for logging out as an access address, using null information as an access parameter, submitting a request containing the get method to the server according to a crawler rule, namely, a myurllib method, and logging out.
As shown in fig. 4, the step of MyHTTPDAO initializing an HTTP communication class in step B21) of this embodiment includes: and constructing header information of a simulation browser, creating a Cookie Jar object, storing cookie information by using an opener mechanism, and keeping the dialogue information with a server.
The invention also provides an intranet-oriented automatic form declaration and result query system, which comprises computer equipment, wherein the computer equipment is programmed or configured to realize the intranet-oriented automatic form declaration method, the intranet-oriented result query method, the intranet-oriented automatic form declaration method or the intranet-oriented result query method.
In summary, the invention based on the crawler method can automatically log in the intranet and analyze the web page content, automatically extract and submit the examination information to the server, and simultaneously quickly inquire the score, thereby saving a great deal of time for the operator.
The foregoing is considered as illustrative of the preferred embodiments of the invention and is not to be construed as limiting the invention in any way. Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical spirit of the present invention should fall within the protection scope of the technical scheme of the present invention, unless the technical spirit of the present invention departs from the content of the technical scheme of the present invention.
Claims (5)
1. An intranet-oriented automatic form declaration method is characterized by comprising the following steps:
A1) acquiring intranet login information of all the learners and configuring a crawler rule;
A2) the method comprises the following steps of selecting the intranet login information of a learner to log in a server, crawling the answer of a test paper and submitting the answer to the server, wherein the method specifically comprises the following steps:
A21) defining a MyHTTPDAO class by utilizing a Python internal urllib library, initializing an HTTP communication class by the MyHTTPDAO class to establish a basic communication protocol with a server, and finishing a communication session for keeping the cookie by utilizing an opener mechanism;
A22) Taking account number and password information in the login information of the intranet of the learner as access parameters, constructing an http entry address post _ url _ login for logging in the intranet as an access address, and logging in a server according to a crawler rule;
A23) constructing a static address url _ myCenter for acquiring personal information as an access address, storing cookie information by using an opener mechanism to determine whether an access parameter is empty, accessing a server by using a corresponding method, acquiring webpage information according to a crawler rule, and extracting the personal login name of a learner in response parameters;
A24) constructing a static address post _ url _ getExam for acquiring personal examination records as an access address, taking row and column information and page information as access parameters, acquiring webpage information according to a crawler rule, extracting examination information of a learner in the last week, and storing the examination information in an examination library;
A25) constructing a static address post _ url _ UserExam used for confirming taking of an examination as an access address, acquiring examination paper id of a last week of a learner from an examination library, taking the examination paper id and flag information of the last week of the learner as access parameters, acquiring webpage information according to a crawler rule, and entering step 2.6) if the value of a response parameter is a preset first identifier, otherwise, skipping to step A210);
A26) Constructing a static address url _ goExam used for acquiring the test paper number of the learner as an access address, taking the examination test paper id of the last week of the learner as an access parameter, acquiring webpage information according to a crawler rule, extracting the personal examination information of the learner, and finding the test paper number of the learner by adopting a regular expression;
A27) constructing a static address post _ url _ showExam used for acquiring test paper information as an access address, taking the number of the test paper of a learner as an access parameter, acquiring webpage information according to a crawler rule, extracting test paper answers, constructing a list containing the test paper answers, and constructing a dictionary containing the finally combined test paper information according to the list;
A28) constructing a static address post _ url _ checksumitexam for confirming the submission of the test paper information as an access address, taking the test paper id of the last week of the learner as an access parameter, acquiring webpage information according to a crawler rule, and entering a step 2.9) if the value of a response parameter is a preset second identifier, otherwise, jumping to a step A210);
A29) constructing a static address post _ url _ submituExam used for submitting test paper information as an access address, and sending the dictionary to the address post _ url _ submituExam;
A210) Constructing a static address post _ url _ logout for logging out as an access address, taking null information as an access parameter, submitting the null information to a server according to a crawler rule, and logging out;
A3) and D, judging whether the intranet login information of all the learners is traversed or not, if so, ending and exiting, and otherwise, returning to the step A2).
2. The automatic declaration method of the form oriented to the intranet of claim 1, wherein the crawler rule specifically includes:
s1) inputting an access address and an access parameter;
s2) creating an HTTP access request object as a mechanism for accessing the server;
s3) judging whether the access parameter is empty, if so, accessing the server by a get method, otherwise, accessing the server by a post method;
s4) decoding the response parameter returned by the server.
3. An intranet-oriented score query method is characterized by comprising the following steps:
B1) acquiring intranet login information of all the learners and configuring a crawler rule;
B2) the method comprises the following steps of selecting an intranet login information of a learner to log in a server, and then crawling an examination score of the learner, wherein the method specifically comprises the following steps:
B21) defining a MyHTTPDAO class by utilizing a Python internal urllib library, initializing an HTTP communication class by the MyHTTPDAO class to establish a basic communication protocol with a server, and finishing a communication session for keeping the cookie by utilizing an opener mechanism;
B22) Taking account number and password information in the login information of the intranet of the learner as access parameters, constructing an http entry address post _ url _ login for logging in the intranet as an access address, and logging in a server according to a crawler rule;
B23) constructing a static address url _ myCenter for acquiring personal information as an access address, storing cookie information by using an opener mechanism to determine whether an access parameter is empty, accessing a server by using a corresponding method, acquiring webpage information according to a crawler rule, and extracting the personal login name of a learner in response parameters;
B24) constructing a static address post _ url _ findMyResults used for inquiring personal examination results as an access address, taking row information and column information and page information as access parameters, acquiring webpage information according to a crawler rule, and extracting the examination results of the last week of a learner;
B25) constructing a static address post _ url _ logout for logging out as an access address, taking null information as an access parameter, submitting the null information to a server according to a crawler rule, and logging out;
B3) and (4) judging whether the intranet login information of all the learners is traversed or not, if so, ending and exiting, and otherwise, returning to the step B2).
4. The intranet-oriented achievement query method according to claim 3, wherein the crawler rules specifically include:
S1) inputting an access address and an access parameter;
s2) creating an HTTP access request object as a mechanism for accessing the server;
s3) judging whether the access parameter is empty, if so, accessing the server by a get method, otherwise, accessing the server by a post method;
s4) decoding the response parameter returned by the server.
5. An intranet-oriented form automatic declaration and achievement inquiry system comprises computer equipment, and is characterized in that the computer equipment is programmed or configured to realize the intranet-oriented form automatic declaration method of claim 1 or 2, or is programmed or configured to realize the intranet-oriented achievement inquiry method of claim 3 or 4, or is programmed or configured to realize the intranet-oriented form automatic declaration method of claim 1 or 2 or the intranet-oriented achievement inquiry method of claim 3 or 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010710279.8A CN111859072A (en) | 2020-07-22 | 2020-07-22 | Automatic form declaration and score query method and system for intranet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010710279.8A CN111859072A (en) | 2020-07-22 | 2020-07-22 | Automatic form declaration and score query method and system for intranet |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111859072A true CN111859072A (en) | 2020-10-30 |
Family
ID=73000837
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010710279.8A Pending CN111859072A (en) | 2020-07-22 | 2020-07-22 | Automatic form declaration and score query method and system for intranet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111859072A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114172749A (en) * | 2022-02-14 | 2022-03-11 | 北京百度网讯科技有限公司 | Test paper downloading method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011034309A2 (en) * | 2009-09-18 | 2011-03-24 | Choi Tae-Ho | Test-based electronic learning system and method for same |
CN108090091A (en) * | 2016-11-23 | 2018-05-29 | 北京国双科技有限公司 | Web page crawl method and apparatus |
CN109933701A (en) * | 2019-03-08 | 2019-06-25 | 四川大学 | A kind of microblog data acquisition methods based on more strategy fusions |
CN111191097A (en) * | 2019-12-20 | 2020-05-22 | 天阳宏业科技股份有限公司 | Method, device and system for automatically acquiring webpage information by web crawler |
-
2020
- 2020-07-22 CN CN202010710279.8A patent/CN111859072A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011034309A2 (en) * | 2009-09-18 | 2011-03-24 | Choi Tae-Ho | Test-based electronic learning system and method for same |
CN108090091A (en) * | 2016-11-23 | 2018-05-29 | 北京国双科技有限公司 | Web page crawl method and apparatus |
CN109933701A (en) * | 2019-03-08 | 2019-06-25 | 四川大学 | A kind of microblog data acquisition methods based on more strategy fusions |
CN111191097A (en) * | 2019-12-20 | 2020-05-22 | 天阳宏业科技股份有限公司 | Method, device and system for automatically acquiring webpage information by web crawler |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114172749A (en) * | 2022-02-14 | 2022-03-11 | 北京百度网讯科技有限公司 | Test paper downloading method, device, equipment and storage medium |
CN114172749B (en) * | 2022-02-14 | 2022-05-17 | 北京百度网讯科技有限公司 | Test paper downloading method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7185272B2 (en) | Method for automatically filling in web forms | |
US6912563B1 (en) | Methods and systems for proactive on-line communications | |
CA2679967C (en) | System and method for providing application penetration testing | |
US20160171050A1 (en) | Distributed Analytical Search Utilizing Semantic Analysis of Natural Language | |
CN104881603B (en) | Webpage redirects leak detection method and device | |
CN104063401B (en) | The method and apparatus that a kind of webpage pattern address merges | |
CN109376291B (en) | Website fingerprint information scanning method and device based on web crawler | |
CN102033934B (en) | A kind of server end forming the method for enquirement, device and knowledge Q-A system | |
US20040163040A1 (en) | Enterprise employment webservice and process | |
CN108664559A (en) | A kind of automatic crawling method of website and webpage source code | |
CN103294732A (en) | Web page crawling method and spider | |
CN110266661A (en) | A kind of authorization method, device and equipment | |
US20170017695A1 (en) | Question and answer information providing system, information processing device, and non-transitory computer-readable medium | |
CN107590236B (en) | Big data acquisition method and system for building construction enterprises | |
CN102760150A (en) | Webpage extraction method based on attribute reproduction and labeled path | |
US20020051956A1 (en) | System and method for remote learning, such as for costs and benefits personnel and professionals | |
CN106598991A (en) | Web crawler system capable of realizing website interaction and automatic form extraction by conversational mode | |
CN106446113A (en) | Mobile big data analysis method and device | |
CN107918575A (en) | The monitoring method and device of a kind of page status | |
CN110532762A (en) | A method of it obtaining identifying code picture and carries out logging in explosion test | |
US20020073160A1 (en) | Multi-site automatic posting and verification tool | |
CN111859072A (en) | Automatic form declaration and score query method and system for intranet | |
CN103618742B (en) | Webmaster's method for verifying authority | |
CN105912573A (en) | Data updating method and data updating device | |
Ping et al. | SQL Injection Teaching Based on SQLi-labs |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |