CN108334585A - A kind of spiders method, apparatus and electronic equipment - Google Patents
A kind of spiders method, apparatus and electronic equipment Download PDFInfo
- Publication number
- CN108334585A CN108334585A CN201810082538.XA CN201810082538A CN108334585A CN 108334585 A CN108334585 A CN 108334585A CN 201810082538 A CN201810082538 A CN 201810082538A CN 108334585 A CN108334585 A CN 108334585A
- Authority
- CN
- China
- Prior art keywords
- page
- information
- configuration information
- crawling
- list page
- 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 51
- 241000239290 Araneae Species 0.000 title abstract 2
- 230000009193 crawling Effects 0.000 claims description 64
- 238000007781 pre-processing Methods 0.000 claims description 14
- 238000012545 processing Methods 0.000 claims description 12
- 238000012423 maintenance Methods 0.000 abstract description 4
- 238000012986 modification Methods 0.000 abstract description 3
- 230000004048 modification Effects 0.000 abstract description 3
- 241000270322 Lepidosauria Species 0.000 abstract 1
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 10
- 230000006872 improvement Effects 0.000 description 9
- 238000004590 computer program Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 7
- 230000008859 change Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000000750 progressive effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 229920001296 polysiloxane Polymers 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
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
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
Abstract
This specification embodiment discloses a kind of spiders method, apparatus and electronic equipment, the method includes:Based on configuration template, configuration information is set;Wherein, the configuration information includes list page configuration information and detail page configuration information;According to the list page configuration information, list page information is crawled;The list page information based on acquisition and the detail page configuration information, crawl specify information.Configuration information and code are decoupled by configuration template, reduce the dependence of bottom code and reptile configuration, user is not needed and treats again and crawl the rules and contents of webpage and analyze, newly increased requirement can be met and without the purpose of modification code;The maintenance cost of code is reduced, code utilization ratio is improved.Meanwhile the configuration information of corresponding a variety of network address rules, field rule, web page coding type etc. is preset in the configuration template, a variety of demands of user and extension demand can be met, the scope of application of code has also been enlarged.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a web crawler method and apparatus, and an electronic device.
Background
With the development of network technology, more and more data are contained in the network, and people usually adopt a crawler technology to acquire data from a webpage or a database if the people want to acquire the data.
In the crawler scheme in the prior art, generally, a website needing to be crawled is selected firstly, and one or more websites can be selected to determine information such as specific contents needing to be crawled; then, analyzing the website by a professional, and determining an extraction rule after analyzing the website with the crawl; according to the code compiling method, codes are revised again if new websites need to be crawled or some new contents in the original crawled websites need to be crawled, and then the codes are fixed to execute crawler tasks. The threshold of data crawling is improved, and the workload is increased; meanwhile, because any field or website change, the code must be modified to realize, the user can not flexibly configure, the expandability is low, and the general effect is poor.
Based on the prior art, a solution is needed to enable simple and efficient configuration of crawlers.
Disclosure of Invention
The embodiment of the specification provides a webpage crawler method, a webpage crawler device and electronic equipment, and is used for solving the following technical problems: there is a need for a solution that enables simple and efficient configuration of crawlers.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
the webpage crawler method provided by the embodiment of the specification comprises the following steps:
setting configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
crawling the list page information according to the list page configuration information;
and crawling specified information based on the acquired list page information and the detailed page configuration information.
Further, the configuration template is preset according to a code specification and is used for setting the configuration information.
Further, the list page configuration information includes: web address to be crawled and website page turning rules;
the detailed page configuration information includes: field information, field rules.
Further, crawling the list page according to the list page configuration information specifically includes:
acquiring a task address;
reading the website to be crawled and/or the website page turning rule according to the task address;
and crawling field information and detailed page websites contained in the list page information according to the websites to be crawled and/or the website page turning rules.
Further, the website page turning rule comprises:
directly extracting the website or obtaining the website through simulated clicking.
Further, the crawling of the specified information based on the acquired list page information and the detailed page configuration information specifically includes:
preprocessing field information and detailed page websites contained in the list page information according to a preset processing rule;
and crawling corresponding specified information according to the preprocessing result and the field rule.
The webpage crawler device provided by the embodiment of the specification comprises:
the configuration module is used for setting configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
the first crawling module crawls list page information according to the list page configuration information;
and the second crawling module crawls specified information based on the acquired list page information and the detailed page configuration information.
Further, the configuration template is preset according to a code specification and is used for setting the configuration information.
Further, the list page configuration information includes: web address to be crawled and website page turning rules;
the detailed page configuration information includes: field information, field rules.
Further, crawling the list page according to the list page configuration information specifically includes:
acquiring a task address;
reading the website to be crawled and/or the website page turning rule according to the task address;
and crawling field information and detailed page websites contained in the list page information according to the websites to be crawled and/or the website page turning rules.
Further, the website page turning rule comprises:
directly extracting the website or obtaining the website through simulated clicking.
Further, the crawling of the specified information based on the acquired list page information and the detailed page configuration information specifically includes:
preprocessing field information and detailed page websites contained in the list page information according to a preset processing rule;
and crawling corresponding specified information according to the preprocessing result and the field rule.
An electronic device provided in an embodiment of the present specification includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
setting configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
crawling the list page information according to the list page configuration information;
and crawling specified information based on the acquired list page information and the detailed page configuration information.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
configuration information which needs to be fixed in the code originally is extracted and decoupled with the code, so that the dependency of the code and crawler configuration is reduced, a user does not need to analyze rules and contents of a webpage to be crawled, and the purpose of meeting the newly added requirement without modifying the code can be met by generating a preset configuration template for configuration; the maintenance cost of the code is reduced, and the utilization efficiency of the code is improved. Meanwhile, the configuration template is preset with configuration information corresponding to various website rules, field rules, webpage coding types and the like, so that various requirements and expansion requirements of users can be met, and the application range of codes is expanded.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a schematic diagram of a web crawler process involved in a practical application scenario according to the solution of the present specification;
fig. 2 is a schematic flowchart of a web crawler method provided in an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a flow of a list page crawling method provided in an embodiment of the present specification;
fig. 4 is a schematic diagram illustrating a flow of a detailed page crawling method provided in an embodiment of the present specification;
fig. 5 is a schematic diagram of a web crawler apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
Fig. 1 is a schematic diagram of a web crawler process involved in a practical application scenario of the solution of the present specification. For example, when a user wants to crawl content related to a topic, the user can set information such as a website to be crawled, field information to be crawled, website rules, and field rules through a configuration template. After the configuration template is set, a list page including detailed page websites, field information and the like is crawled according to configuration information, and further, contents in the detailed page websites are crawled according to the configuration information to obtain designated information.
It should be noted that the configuration template is designed based on a configuration database and a visual interface, and can be used for a user to visually fill in configuration information, and the configuration template can preset configuration information for crawling various website rules and field rules. In addition, the configuration template shown in fig. 1 is shown in the form of a server, and the characterization configuration template may run on the server, which is not only a single server, but also may adopt a cluster or distributed architecture (these two architectures are not shown in the figure).
Based on the above-described scenarios, the following describes the embodiments of the present specification in detail.
Fig. 2 is a schematic flow chart of a web crawler method provided in an embodiment of the present specification, where the method specifically includes the following steps:
step S201: setting configuration information based on the configuration template; wherein the configuration information includes list page configuration information and detail page configuration information.
The configuration template may be configured with configuration information via a UI (User Interface). The configuration information may include website related configuration information (e.g., URL rules), web page configuration information (e.g., web page encoding rules), and so on. The configuration template can add configuration information according to the requirements of the user, for example, the key field 'house price' configured by the user for the first time, and the user wants to further know the related information of 'loan', so the user can further add the key field 'loan' for further crawling; therefore, different requirements of users can be met, the application range is enlarged, meanwhile, the codes do not need to be modified, the crawler operation is simplified, and the crawling efficiency is improved.
It should be noted that, in practical applications, the list configuration information and the detailed page configuration information are not strictly distinguished, and the field information in the detailed page to be crawled may also be set in the list page configuration information.
Step S203: and crawling the list page information according to the list page configuration information.
The list page mainly contains information of a web page address (URL, Uniform Resource Location) to be crawled. The web addresses in the list page include web addresses specified by the user and also web addresses obtained by crawling. Further, in order to avoid repeated crawling, the websites with crawling and the websites without crawling are stored separately in the list page.
①, the initial URL address can be manually designated by the user, or can be determined by one or more initial crawled web pages designated by the user. ②, according to the initial URL, crawls the web page in the corresponding URL address and obtains a new URL.after obtaining the initial URL address, the web page is stored in the original list page after crawling the web page in the corresponding URL address, and the new URL address is found while crawling the web page, and the crawled URL address is stored in a URL list page for the process of deduplication and judgment of crawling. ③, the new URL is placed in the queue of the URL list page.after obtaining the next new URL address in ②, the new URL address is placed in the URL list page queue. ④, reads the new URL from the queue, and according to the new URL, crawls the new URL, and repeats the process.
Step S205: and crawling specified information based on the acquired list page information and the detailed page configuration information.
The detailed page referred to herein may be understood as a web site page (i.e., URL) designated by a user, and crawling of the designated information is performed based on the designated web page. The specified information may be a user-specified type of subject, specific field information, or the like. In the crawling process, list page information is crawled according to detailed page configuration information, decoupling is achieved between a configuration template and a bottom layer code (for example, the title of an article is crawled, the configuration can be { ' field ', ' type ', ' xpath ', ' val ': tr [1]/td [2]/a/text () '), a user can adjust the configuration information in the crawling process, the bottom layer code does not need to be changed, and crawler efficiency can be effectively improved.
According to the embodiment, the configuration information which is originally required to be fixed in the code is extracted and decoupled with the code, so that the dependency of the code and the crawler configuration is reduced, the rule and the content of the webpage to be crawled do not need to be analyzed by a user, and the purpose of meeting the newly added requirement without modifying the code can be met by generating the preset configuration template for configuration; the maintenance cost of the code is reduced, and the utilization efficiency of the code is improved. Meanwhile, the configuration template is preset with configuration information corresponding to various website rules, field rules, webpage coding types and the like, so that various requirements and expansion requirements of users can be met, and the application range of codes is expanded.
In one or more embodiments of the present disclosure, the configuration template is preset according to a code specification, and is used to set the configuration information.
In order to meet the requirement of user-defined configuration information, various configuration information ports are preset in the configuration template, and the configuration template and the bottom layer codes can be decoupled corresponding to the bottom layer codes with different functions. Under the condition that a user does not know the bottom layer code, the user can set the specific information which the user wants to crawl based on the configuration template, and the crawling work efficiency can be effectively improved.
In one or more embodiments of the present specification, the list page configuration information includes: web address to be crawled and website page turning rules; the detailed page configuration information includes: field information, field rules.
As described above, the list page contains the website information (i.e., URL) to be crawled. In the actual crawling process, crawling is required according to an initial URL, and the initial URL can be directly provided by a user or determined according to some initial crawling webpage or initial crawling webpages specified by the user. To acquire the website, a page turning rule that may exist in the web page needs to be preset so as to more easily crawl to the desired website.
In the detailed page configuration information, a rule related to specific crawling of specified information, for example, crawled subject information, a URL rule, or the like, is often set.
In one or more embodiments of the present specification, the crawling a list page according to the list page configuration information may include, as shown in fig. 3: step S301: acquiring a task address; step S303: reading the website to be crawled and/or the website page turning rule according to the task address; step S305: and crawling field information and detailed page websites contained in the list page information according to the websites to be crawled and/or the website page turning rules.
Specifically, the task address may be a unique number automatically assigned to the task by the system, and for example, after the number is set to 1 from the first task address, the other task addresses are sequentially incremented.
In one or more embodiments of the present specification, the website page turning rule includes: directly extracting the website or obtaining the website through simulated clicking.
In practical application, the page turning operation of the website can be realized by simulating clicking, and some website information is directly in the webpage content. The webpage turning rules for different websites are different and need to be predefined in the configuration template. For example, if a connection button of "next page" is included in the current web page, a specific URL can be obtained by simulating a click if the web address of "next page" is to be crawled.
In one or more embodiments of the present specification, the crawling of the specific information based on the acquired list page information and the detailed page configuration information may include, as shown in fig. 4, the following steps: step S401: preprocessing field information and detailed page websites contained in the list page information according to a preset processing rule; step S403: and crawling corresponding specified information according to the preprocessing result and the field rule.
The pre-processing rules referred to herein may include pre-processing of the URL (i.e., parsing the URL), analysis of the data format, parsing of the web page encoding, and extraction of valuable data.
Based on the same idea, an embodiment of the present specification further provides a web crawler apparatus, as shown in fig. 5, including:
a configuration module 501, which sets configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
the first crawling module 502 crawls the list page information according to the list page configuration information;
the second crawling module 503 crawls specified information based on the acquired list page information and the detailed page configuration information.
Further, the configuration template is preset according to a code specification and is used for setting the configuration information.
Further, the list page configuration information includes: web address to be crawled and website page turning rules;
the detailed page configuration information includes: field information, field rules.
Further, crawling the list page according to the list page configuration information specifically includes:
acquiring a task address;
reading the website to be crawled and/or the website page turning rule according to the task address;
and crawling field information and detailed page websites contained in the list page information according to the websites to be crawled and/or the website page turning rules.
Further, the website page turning rule comprises:
directly extracting the website or obtaining the website through simulated clicking.
Further, the crawling of the specific information based on the acquired list page information and the detailed page configuration information may specifically include:
preprocessing field information and detailed page websites contained in the list page information according to a preset processing rule;
and crawling corresponding specified information according to the preprocessing result and the field rule.
Based on the same idea, an embodiment of this specification further provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
setting configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
crawling the list page information according to the list page configuration information;
and crawling specified information based on the acquired list page information and the detailed page configuration information.
Based on the embodiment, the configuration information which is originally required to be fixed in the code is extracted and decoupled with the code, so that the dependency of the code and the crawler configuration is reduced, the rule and the content of the webpage to be crawled do not need to be analyzed by a user, and the purpose of meeting the newly added requirement without modifying the code can be met by generating a preset configuration template for configuration; the maintenance cost of the code is reduced, and the utilization efficiency of the code is improved. Meanwhile, the configuration template is preset with configuration information corresponding to various website rules, field rules, webpage coding types and the like, so that various requirements and expansion requirements of users can be met, and the application range of codes is expanded.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the electronic device, and the nonvolatile computer storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the partial description of the embodiments of the method.
The apparatus, the electronic device, the nonvolatile computer storage medium and the method provided in the embodiments of the present description correspond to each other, and therefore, the apparatus, the electronic device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (13)
1. A web crawler method, comprising:
setting configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
crawling the list page information according to the list page configuration information;
and crawling specified information based on the acquired list page information and the detailed page configuration information.
2. The web crawler method of claim 1, wherein the configuration template is pre-set according to a code specification for setting the configuration information.
3. The web crawler method of claim 1,
the list page configuration information includes: web address to be crawled and website page turning rules;
the detailed page configuration information includes: field information, field rules.
4. The web page crawler method according to claim 3, wherein the crawling of the list pages according to the list page configuration information specifically comprises:
acquiring a task address;
reading the website to be crawled and/or the website page turning rule according to the task address;
and crawling field information and detailed page websites contained in the list page information according to the websites to be crawled and/or the website page turning rules.
5. The web page crawler method of claim 4, wherein the web page flipping rules comprise:
directly extracting the website or obtaining the website through simulated clicking.
6. The web page crawler method according to claim 4, wherein crawling specified information based on the acquired list page information and the detailed page configuration information specifically comprises:
preprocessing field information and detailed page websites contained in the list page information according to a preset processing rule;
and crawling corresponding specified information according to the preprocessing result and the field rule.
7. A web crawler apparatus, comprising:
the configuration module is used for setting configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
the first crawling module crawls list page information according to the list page configuration information;
and the second crawling module crawls specified information based on the acquired list page information and the detailed page configuration information.
8. The web crawler apparatus according to claim 7, wherein the configuration template is preset according to a code specification for setting the configuration information.
9. The web crawler apparatus according to claim 7,
the list page configuration information includes: web address to be crawled and website page turning rules;
the detailed page configuration information includes: field information, field rules.
10. The web page crawler apparatus according to claim 9, wherein the crawling of the list page according to the list page configuration information specifically comprises:
acquiring a task address;
reading the website to be crawled and/or the website page turning rule according to the task address;
and crawling field information and detailed page websites contained in the list page information according to the websites to be crawled and/or the website page turning rules.
11. The web crawler apparatus of claim 10, wherein said web page flipping rules comprise:
directly extracting the website or obtaining the website through simulated clicking.
12. The web page crawler apparatus according to claim 10, wherein the crawling of the specific information based on the acquired list page information and the detailed page configuration information specifically comprises:
preprocessing field information and detailed page websites contained in the list page information according to a preset processing rule;
and crawling corresponding specified information according to the preprocessing result and the field rule.
13. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
setting configuration information based on the configuration template; wherein the configuration information comprises list page configuration information and detail page configuration information;
crawling the list page information according to the list page configuration information;
and crawling specified information based on the acquired list page information and the detailed page configuration information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810082538.XA CN108334585A (en) | 2018-01-29 | 2018-01-29 | A kind of spiders method, apparatus and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810082538.XA CN108334585A (en) | 2018-01-29 | 2018-01-29 | A kind of spiders method, apparatus and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108334585A true CN108334585A (en) | 2018-07-27 |
Family
ID=62926421
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810082538.XA Pending CN108334585A (en) | 2018-01-29 | 2018-01-29 | A kind of spiders method, apparatus and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108334585A (en) |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109190062A (en) * | 2018-08-03 | 2019-01-11 | 平安科技(深圳)有限公司 | Crawling method, device and the storage medium of target corpus data |
CN109460522A (en) * | 2018-10-30 | 2019-03-12 | 北京网众共创科技有限公司 | The acquisition methods and device of site information |
CN109582853A (en) * | 2018-12-19 | 2019-04-05 | 平安科技(深圳)有限公司 | Data information acquisition methods, device, computer equipment and storage medium |
CN109597952A (en) * | 2018-12-10 | 2019-04-09 | 江苏满运软件科技有限公司 | Web information processing method, system, electronic equipment and storage medium |
CN109614535A (en) * | 2018-11-29 | 2019-04-12 | 甘肃万维信息技术有限责任公司 | A kind of acquisition method and device of the network data based on Scrapy frame |
CN110245278A (en) * | 2018-09-05 | 2019-09-17 | 爱信诺征信有限公司 | Acquisition method, device, electronic equipment and the storage medium of web data |
CN110968754A (en) * | 2018-09-28 | 2020-04-07 | 北京国双科技有限公司 | Detection method and device for crawler page turning strategy |
CN110968758A (en) * | 2018-09-30 | 2020-04-07 | 北京国双科技有限公司 | Webpage data crawling method and device |
CN111414523A (en) * | 2020-03-11 | 2020-07-14 | 中国建设银行股份有限公司 | Data acquisition method and device |
WO2020211249A1 (en) * | 2019-04-19 | 2020-10-22 | 平安科技(深圳)有限公司 | Network shopping guiding method and apparatus based on data crawling |
CN112231534A (en) * | 2020-10-14 | 2021-01-15 | 上海蜜度信息技术有限公司 | A method and device for configuring a crawler |
CN112541104A (en) * | 2019-09-20 | 2021-03-23 | 浙江大搜车软件技术有限公司 | Data capturing method and device |
CN112650570A (en) * | 2020-12-29 | 2021-04-13 | 百果园技术(新加坡)有限公司 | Dynamically expandable distributed crawler system, data processing method and device |
CN112836106A (en) * | 2019-11-25 | 2021-05-25 | 北京国双科技有限公司 | Method and device for creating data crawling application, storage medium and equipment |
CN113569181A (en) * | 2021-07-29 | 2021-10-29 | 山东亿云信息技术有限公司 | Page data acquisition method and system |
CN113761863A (en) * | 2021-08-27 | 2021-12-07 | 山东浪潮通软信息科技有限公司 | List page configuration method, device and storage medium |
CN113918792A (en) * | 2021-11-12 | 2022-01-11 | 中煤(西安)地下空间科技发展有限公司 | Web page data crawling method, device and local server |
CN113934912A (en) * | 2021-11-11 | 2022-01-14 | 北京搜房科技发展有限公司 | Data crawling method and device, storage medium and electronic equipment |
CN114428635A (en) * | 2022-04-06 | 2022-05-03 | 杭州未名信科科技有限公司 | Data acquisition method and device, electronic equipment and storage medium |
CN114691129A (en) * | 2020-12-31 | 2022-07-01 | 上海维略信息科技有限公司 | Automatic development method for low-code development platform based on design model |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090248622A1 (en) * | 2008-03-26 | 2009-10-01 | International Business Machines Corporation | Method and device for indexing resource content in computer networks |
CN102867053A (en) * | 2012-09-12 | 2013-01-09 | 北京奇虎科技有限公司 | Method, device and system for collecting effective information web pages in website information |
CN103605764A (en) * | 2013-11-26 | 2014-02-26 | Tcl集团股份有限公司 | Web crawler system and web crawler multitask executing and scheduling method |
CN106649371A (en) * | 2015-10-30 | 2017-05-10 | 北京国双科技有限公司 | Data processing method and device for crawlers |
CN106844522A (en) * | 2016-12-29 | 2017-06-13 | 北京市天元网络技术股份有限公司 | A kind of network data crawling method and device |
-
2018
- 2018-01-29 CN CN201810082538.XA patent/CN108334585A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090248622A1 (en) * | 2008-03-26 | 2009-10-01 | International Business Machines Corporation | Method and device for indexing resource content in computer networks |
CN102867053A (en) * | 2012-09-12 | 2013-01-09 | 北京奇虎科技有限公司 | Method, device and system for collecting effective information web pages in website information |
CN103605764A (en) * | 2013-11-26 | 2014-02-26 | Tcl集团股份有限公司 | Web crawler system and web crawler multitask executing and scheduling method |
CN106649371A (en) * | 2015-10-30 | 2017-05-10 | 北京国双科技有限公司 | Data processing method and device for crawlers |
CN106844522A (en) * | 2016-12-29 | 2017-06-13 | 北京市天元网络技术股份有限公司 | A kind of network data crawling method and device |
Cited By (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109190062A (en) * | 2018-08-03 | 2019-01-11 | 平安科技(深圳)有限公司 | Crawling method, device and the storage medium of target corpus data |
CN109190062B (en) * | 2018-08-03 | 2023-04-07 | 平安科技(深圳)有限公司 | Crawling method and device for target corpus data and storage medium |
CN110245278A (en) * | 2018-09-05 | 2019-09-17 | 爱信诺征信有限公司 | Acquisition method, device, electronic equipment and the storage medium of web data |
CN110968754B (en) * | 2018-09-28 | 2023-04-07 | 北京国双科技有限公司 | Detection method and device for crawler page turning strategy |
CN110968754A (en) * | 2018-09-28 | 2020-04-07 | 北京国双科技有限公司 | Detection method and device for crawler page turning strategy |
CN110968758A (en) * | 2018-09-30 | 2020-04-07 | 北京国双科技有限公司 | Webpage data crawling method and device |
CN109460522A (en) * | 2018-10-30 | 2019-03-12 | 北京网众共创科技有限公司 | The acquisition methods and device of site information |
CN109614535A (en) * | 2018-11-29 | 2019-04-12 | 甘肃万维信息技术有限责任公司 | A kind of acquisition method and device of the network data based on Scrapy frame |
CN109614535B (en) * | 2018-11-29 | 2021-10-08 | 中电万维信息技术有限责任公司 | Method and device for acquiring network data based on Scapy framework |
CN109597952A (en) * | 2018-12-10 | 2019-04-09 | 江苏满运软件科技有限公司 | Web information processing method, system, electronic equipment and storage medium |
CN109582853A (en) * | 2018-12-19 | 2019-04-05 | 平安科技(深圳)有限公司 | Data information acquisition methods, device, computer equipment and storage medium |
WO2020211249A1 (en) * | 2019-04-19 | 2020-10-22 | 平安科技(深圳)有限公司 | Network shopping guiding method and apparatus based on data crawling |
CN112541104A (en) * | 2019-09-20 | 2021-03-23 | 浙江大搜车软件技术有限公司 | Data capturing method and device |
CN112836106A (en) * | 2019-11-25 | 2021-05-25 | 北京国双科技有限公司 | Method and device for creating data crawling application, storage medium and equipment |
CN111414523A (en) * | 2020-03-11 | 2020-07-14 | 中国建设银行股份有限公司 | Data acquisition method and device |
CN112231534A (en) * | 2020-10-14 | 2021-01-15 | 上海蜜度信息技术有限公司 | A method and device for configuring a crawler |
CN112650570A (en) * | 2020-12-29 | 2021-04-13 | 百果园技术(新加坡)有限公司 | Dynamically expandable distributed crawler system, data processing method and device |
CN112650570B (en) * | 2020-12-29 | 2024-09-20 | 百果园技术(新加坡)有限公司 | Dynamically-extensible distributed crawler system, data processing method and device |
CN114691129A (en) * | 2020-12-31 | 2022-07-01 | 上海维略信息科技有限公司 | Automatic development method for low-code development platform based on design model |
CN114691129B (en) * | 2020-12-31 | 2025-02-21 | 北京正元智晟科技有限公司 | An automated development method based on design model for low-code development platform |
CN113569181A (en) * | 2021-07-29 | 2021-10-29 | 山东亿云信息技术有限公司 | Page data acquisition method and system |
CN113569181B (en) * | 2021-07-29 | 2024-12-20 | 山东亿云信息技术有限公司 | A paging data collection method and system |
CN113761863A (en) * | 2021-08-27 | 2021-12-07 | 山东浪潮通软信息科技有限公司 | List page configuration method, device and storage medium |
CN113934912A (en) * | 2021-11-11 | 2022-01-14 | 北京搜房科技发展有限公司 | Data crawling method and device, storage medium and electronic equipment |
CN113918792A (en) * | 2021-11-12 | 2022-01-11 | 中煤(西安)地下空间科技发展有限公司 | Web page data crawling method, device and local server |
CN114428635A (en) * | 2022-04-06 | 2022-05-03 | 杭州未名信科科技有限公司 | Data acquisition method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108334585A (en) | A kind of spiders method, apparatus and electronic equipment | |
EP3667493B1 (en) | A method for a software development system | |
CN110427215A (en) | A kind of program version mRNA differential display mRNA method and device applied to front end exploitation | |
CN110245002B (en) | System interaction method, device, equipment and storage medium | |
CN107622080B (en) | Data processing method and equipment | |
CN105868166B (en) | Regular expression generation method and system | |
CN105824830B (en) | Method, client and equipment for displaying page | |
CN109241026B (en) | Data management method, device and system | |
CN109947643B (en) | A/B test-based experimental scheme configuration method, device and equipment | |
CN113076096A (en) | Desktop application program development method, device, equipment and storage medium | |
CN112307509A (en) | Desensitization processing method, equipment, medium and electronic equipment | |
CN108874379B (en) | Page processing method and device | |
CN113360385B (en) | A test method, device, equipment and medium | |
CN110989999A (en) | Code generation method and device, electronic equipment and medium | |
CN108846069B (en) | Document execution method and device based on markup language | |
CN112231197A (en) | Page testing method and device and storage medium | |
CN104899203B (en) | Webpage generation method and device and terminal equipment | |
CN107391529B (en) | Method and device for realizing Object Relation Mapping (ORM) | |
CN106156109A (en) | A kind of searching method and device | |
CN111538667A (en) | Page testing method and device | |
CN112307371B (en) | Applet sub-service identification method, device, equipment and storage medium | |
CN112732252A (en) | Method and device for dynamically generating UI (user interface) and electronic equipment | |
CN111142871A (en) | Front-end page development system, method, equipment and medium | |
CN107239270B (en) | Code processing method and device | |
CN115292196A (en) | User interface testing method, device, electronic device and readable storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180727 |
|
RJ01 | Rejection of invention patent application after publication |