CN110704784A - Web page screen capturing method, device, equipment and computer readable storage medium - Google Patents

Web page screen capturing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110704784A
CN110704784A CN201910959926.6A CN201910959926A CN110704784A CN 110704784 A CN110704784 A CN 110704784A CN 201910959926 A CN201910959926 A CN 201910959926A CN 110704784 A CN110704784 A CN 110704784A
Authority
CN
China
Prior art keywords
page
web page
identifier
request
screen capture
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
Application number
CN201910959926.6A
Other languages
Chinese (zh)
Inventor
李为
卢道和
林挺
黄山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910959926.6A priority Critical patent/CN110704784A/en
Publication of CN110704784A publication Critical patent/CN110704784A/en
Priority to PCT/CN2020/117821 priority patent/WO2021068765A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The invention relates to the technical field of financial technology (Fintech), and discloses a web page screen capturing method, which comprises the following steps: when a web page screen capturing request is received, acquiring a page identifier corresponding to the web page screen capturing request, and loading page information corresponding to the page identifier; when the loading of the page information corresponding to the page identifier is completed, calculating the actual size of the web page corresponding to the page identifier according to the page information; and rendering the page according to the actual size and the scaling corresponding to the web page screen capture request to generate a screen capture image. The invention also discloses a web page screen capturing device, equipment and a computer readable storage medium. According to the method and the device, the screen capture image is generated according to the scaling corresponding to the screen capture request, so that the screen capture image meets the requirements of the user.

Description

Web page screen capturing method, device, equipment and computer readable storage medium
Technical Field
The invention relates to the technical field of financial technology (Fintech), in particular to a web page screen capturing method, a device, equipment and a computer readable storage medium.
Background
With the rapid development of internet technologies, especially internet financial technology (Fintech), more and more technologies (big data, distributed, Blockchain, artificial intelligence, etc.) are applied in the financial field.
Financial webpage information is increased in an explosive manner, a user usually performs screen capturing operation on a web page when viewing the web page corresponding to finance, the screen capturing operation of the current web page is captured according to the screen size, for example, the screen size is 1920 × 3000, the user can only capture a screen of 1920 × 3000 at most, and if the page size of the web page is larger than 1920 × 3000, the user can only partially capture the screen; if the user needs to capture a partial area smaller than 1920 × 3000 in the web page, the highlighted screenshot display cannot be performed, that is, the screenshot image of the current web page cannot be displayed according to the user's requirement.
Disclosure of Invention
The invention mainly aims to provide a web page screen capturing method, a device, equipment and a computer readable storage medium, and aims to solve the technical problem that the current web page screen capturing image does not meet the requirements of users.
In order to achieve the above object, the present invention provides a web page screen capturing method, which comprises the following steps:
when a web page screen capturing request is received, acquiring a page identifier corresponding to the web page screen capturing request, and loading page information corresponding to the page identifier;
when the loading of the page information corresponding to the page identifier is completed, calculating the actual size of the web page corresponding to the page identifier according to the page information;
and rendering the page according to the actual size and the scaling corresponding to the web page screen capture request to generate a screen capture image.
In an embodiment, the step of acquiring a page identifier corresponding to a web page screen capture request and loading page information corresponding to the page identifier when the web page screen capture request is received includes:
when a web page screen capturing request is received, acquiring a page identifier corresponding to the web page screen capturing request, and determining a page code corresponding to the page identifier;
adding html elements with preset element identifiers in the page codes, and storing the page codes and the html elements as page information in a correlated manner;
when a page loading request is received, loading page information corresponding to the page identifier, and judging whether html elements of preset element identifiers exist in the loaded page information or not;
if the html element of the preset element identification does not exist in the loaded page information, judging that the page information corresponding to the page identification is not loaded;
and if the html element of the preset element identifier exists in the loaded page information, judging that the page information corresponding to the page identifier is completely loaded.
In an embodiment, the step of calculating the actual size of the web page corresponding to the page identifier according to the page information when the loading of the page information corresponding to the page identifier is completed includes:
when the loading of the page information corresponding to the page identifier is completed, obtaining an html element of a preset element identifier in the page information;
and calculating the total element size of the sitting element adjacent to the html element by taking the html element as a starting point, and taking the total element size as the actual size of the web page corresponding to the page identifier.
In an embodiment, before the step of performing page rendering according to the actual size and the scaling corresponding to the web page screenshot request to generate the screenshot image, the method includes:
outputting a scale setting prompt for a user to set a scaling of the screenshot image based on the scale setting prompt;
acquiring a scaling input based on the scale setting prompt, and taking the scaling as a scaling corresponding to the web page screen capturing request;
the step of rendering the page according to the actual size and the scaling corresponding to the web page screen capture request to generate the screen capture image comprises the following steps:
and calculating the product of the actual size and the scaling, taking the product as the display size, and rendering the page according to the display size to generate the screen capture image.
In an embodiment, after the step of performing page rendering according to the actual size and the scaling corresponding to the web page screenshot request to generate the screenshot image, the method includes:
when a screen capture image sharing instruction is received, acquiring a user identifier corresponding to the screen capture image sharing instruction;
and storing the screen capture image to a target path, generating link information corresponding to the target path, and sending the link information to a client corresponding to the user identifier.
In an embodiment, after the step of performing page rendering according to the actual size and the scaling corresponding to the web page screenshot request to generate the screenshot image, the method includes:
when a mail sending request triggered based on the screen capture image is received, acquiring a receiver identification corresponding to the mail sending request;
and adding the screenshot image to a mail interface corresponding to the mail sending request, generating a mail containing the screenshot image and sending a client corresponding to the recipient identification.
In an embodiment, before the step of acquiring a page identifier corresponding to a web page screenshot request and loading page information corresponding to the page identifier when the web page screenshot request is received, the method includes:
when an image adding request triggered based on a mail interface is received, acquiring a page identifier corresponding to the image adding request, and triggering a web page screen capturing request based on the page identifier;
after the step of calculating the actual size of the web page corresponding to the page identifier according to the page information when the loading of the page information corresponding to the page identifier is completed, the method comprises the following steps:
acquiring the interface size of the mail interface, calculating the ratio of the interface size to the actual size, and taking the ratio as the scaling corresponding to the web page screen capturing request;
rendering the page according to the actual size and the scaling corresponding to the web page screen capture request;
and adding the screen shot image to the mail interface, generating a mail containing the screen shot image and sending the mail.
In addition, to achieve the above object, the present invention also provides a web page screen capturing apparatus, including:
the request receiving module is used for acquiring a page identifier corresponding to a web page screen capturing request and loading page information corresponding to the page identifier when the web page screen capturing request is received;
the size calculation module is used for calculating the actual size of the web page corresponding to the page identifier according to the page information when the loading of the page information corresponding to the page identifier is completed;
and the image generation module is used for rendering the page according to the actual size and the scaling corresponding to the web page screen capture request to generate a screen capture image.
In addition, to achieve the above object, the present invention also provides a web page screen capturing apparatus, including: the web page screen capture device comprises a memory, a processor and a web page screen capture program stored on the memory and capable of running on the processor, wherein the steps of the web page screen capture method are realized when the web page screen capture program is executed by the processor.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a web page screen capture program, which when executed by a processor, implements the steps of the web page screen capture method as described above.
The invention provides a web page screen capturing method, a web page screen capturing device, web page screen capturing equipment and a computer readable storage medium. In the embodiment of the invention, when a web page screen capturing request is received, a page identifier corresponding to the web page screen capturing request is obtained, and page information corresponding to the page identifier is loaded; when the loading of the page information corresponding to the page identifier is completed, calculating the actual size of the web page corresponding to the page identifier according to the page information; and rendering the page according to the actual size and the scaling corresponding to the screen capturing request of the web page to generate the screen capturing image.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a web page screenshot method according to the present invention;
FIG. 3 is a diagram illustrating a specific scenario of a first embodiment of a web page screenshot method according to the present invention;
FIG. 4 is a flowchart illustrating a web page screenshot method according to a second embodiment of the present invention;
fig. 5 is a functional module diagram of a web page screen capture device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The web page screen capturing device can be a PC or a server.
As shown in fig. 1, the web page screen capturing apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a web page screen shot.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; the processor 1001 may be configured to call the web page screen capture program stored in the memory 1005, and execute operations in the web page screen capture method described below, and the method implemented when the web page screen capture program running on the processor is executed may refer to each embodiment of the web page screen capture method of the present invention, which is not described herein again.
Based on the hardware structure, the embodiment of the web page screen capturing method is provided.
Referring to fig. 2, fig. 2 is a schematic flowchart of a first embodiment of a web page screen capturing method according to the present invention, where the web page screen capturing method includes:
step S10, when a web page screen capture request is received, a page identifier corresponding to the web page screen capture request is obtained, and page information corresponding to the page identifier is loaded.
The web page screen capturing method in this embodiment is applied to a web page screen capturing device, the web page screen capturing device receives a web page screen capturing request, and a triggering mode of the web page screen capturing request is not specifically limited, that is, the web page screen capturing request may be actively triggered by a user, for example, the user clicks a screen capturing icon on a display interface corresponding to the web page screen capturing device, the web page screen capturing device obtains a page identifier (the page identifier is identifier information for identifying a web page, for example, the page identifier is page address information) corresponding to a current display interface, and triggers the web page screen capturing request based on the page identifier; in addition, the web page screen capture request can also be automatically triggered by the web page screen capture device, for example, the web page screen capture conditions in the web page screen capture device are preset: the method comprises the steps that web page screen capturing is automatically carried out every morning, and when web page screen capturing equipment arrives at the early morning, a web page screen capturing request is automatically triggered.
when the web page screen capturing device receives a web page screen capturing request, the web page screen capturing device obtains a page identifier corresponding to the web page screen capturing request, the web page screen capturing device loads page information corresponding to the page identifier, for example, the page identifier is page address information, the web page screen capturing device queries a preset page code base to obtain page information corresponding to the page address information, so as to complete loading of the page information corresponding to the page identifier.
Step S20, when the loading of the page information corresponding to the page identifier is completed, calculating the actual size of the web page corresponding to the page identifier according to the page information.
The web page screen capturing device detects a loading state of the page information corresponding to the page identifier, and determines whether the page information corresponding to the page identifier is loaded completely, and in this embodiment, the web page screen capturing device determines whether the page information corresponding to the page identifier is loaded completely, which may be implemented in different ways, specifically:
the implementation mode is as follows: the preset time duration in the web page screen capturing device may be set according to a network environment where the web page screen capturing device is located, and the preset time duration may also be set according to an information amount of the page information, for example, the preset time duration is set to 10 minutes, that is, when the web page screen capturing device detects that the page information loading time duration reaches the preset time duration, the web page screen capturing device determines that the page information loading corresponding to the page identifier is completed.
The implementation mode two is as follows: the web page screen capturing device adds a completion mark in a page code corresponding to the page identifier, acquires loaded page information, and judges that the page information corresponding to the page identifier is not completely loaded if the loaded page information does not contain the completion mark; if the loaded page information contains the completion mark, the web page screen capturing device judges that the page information corresponding to the page identifier is completely loaded,
in the implementation manner of this embodiment, a preset time length is set in the first implementation manner to determine whether the page information is completely loaded, and a web page screen capturing device is not required to perform detection operation, but the time required for waiting for the preset time is longer; and the second implementation mode is to detect whether the page information contains a completion mark or not, so that whether the page information is completely loaded or not can be quickly identified, but the web page screen capturing equipment is required to perform detection operation, and when the actual page information is loaded and judged, a user selects a reasonable mode according to a scene.
when the web page screen capturing device detects that the loading of the page information corresponding to the page identifier is completed, the web page screen capturing device calculates the actual size of the web page corresponding to the page identifier according to the loaded page information, namely, the web page screen capturing device analyzes the page information and obtains the image elements contained in the page information and the arrangement mode of each image element, and the web page screen capturing device calculates the actual size of the web page corresponding to the page identifier according to the arrangement mode of each image element and the size of each image element.
For example, a web page contains 4 image elements, namely, an image element 1 (length 10cm and height 5cm), an image element 2 (length 6cm and height 3cm), an image element 3 (length 12cm and height 9cm) and an image element 4 (length 15cm and height 10cm), the image element 1 and the image element 2 are arranged laterally side by side, the image element 3 is below the image element 1 and the image element 2, and the image element 4 is below the image element 3, so that the actual size of the web page is as follows: length 16cm (maximum of 16(10+6), 12 and 15), height 24cm (24 ═ 5(3) +9+ 10).
In this embodiment, when the web page screen capturing device finishes loading the page information, the web page screen capturing device calculates the actual size of the web page according to the page information, and at this time, if the user does not set the size information of the screen capturing image, the web page screen capturing device renders and generates the screen capturing image corresponding to the actual size according to the page information, that is, the web page screen capturing device renders and completes the screen capturing on the web page corresponding to the page identifier in an equal proportion.
In addition, if the user sets the size information of the screen capture image, the web page screen capture device performs the screen capture operation according to the size information set by the user, specifically:
and step S30, performing page rendering according to the actual size and the scaling corresponding to the web page screen capture request, and generating a screen capture image.
The web page screen capturing device obtains a scaling corresponding to the web page screen capturing request, the web page screen capturing device multiplies the scaling by the actual size to obtain a display size of the screen capturing image, and the web page screen capturing device performs page rendering according to the display size to generate the screen capturing image, and specifically, the step S30 is preceded by:
a1, outputting a scale setting prompt for a user to set the scaling of the screenshot image based on the scale setting prompt;
step a2, obtaining the scale ratio input based on the scale setting prompt, and using the scale ratio as the scale ratio corresponding to the web page screen capturing request.
The web page screen capturing equipment outputs a scale setting prompt so that a user can set the scaling of the screen capturing image based on the scale setting prompt; it is understood that the output time, the output mode and the specific content of the proportional setting prompt are not limited, that is, the output time of the proportional setting prompt may be: after a web page screen capture request is received, page information corresponding to a page identifier can be loaded; the output mode of the proportion setting prompt is as follows: it can be voice information or pop-up window prompt.
The web page screen capturing device obtains a scaling ratio input based on the scale setting prompt, the web page screen capturing device takes the scaling ratio input by a user as the scaling ratio corresponding to the web page screen capturing request, the web page screen capturing device conducts page rendering according to the scaling ratio to generate a screen capturing image, namely, the web page screen capturing device calculates the product of the actual size and the scaling ratio to serve as the display size of the screen capturing image, and the web page screen capturing device conducts page rendering according to the display size to generate the screen capturing image.
For example, referring to fig. 3, when the user selects the zoom mode as "actual size" on the web page, the web page screen capture device accurately displays and generates the screen capture image according to the actual size on the web page, and if the user selects the zoom scale of 0.8 (representing that the zoom is 0.8 times of the original component size) on the web page, the web page screen capture device accurately displays and generates the screen capture image according to the actual size on the web page and the zoom scale.
It can be understood that the web page screen capture device also supports a user to directly set the display size of the screen capture image, so that the web page screen capture device performs page rendering according to the display size to generate the screen capture image.
Further, referring to fig. 4, a second embodiment of the web page screen capturing method of the present invention is proposed based on the first embodiment of the web page screen capturing method of the present invention.
This embodiment is a refinement step of step S10 in the first embodiment, and a specific implementation manner for determining whether page information is completely loaded is provided in this embodiment, and includes:
step S11, when a web page screen capture request is received, a page identifier corresponding to the web page screen capture request is obtained, and a page code corresponding to the page identifier is determined.
when the web page screen capturing device receives a web page screen capturing request, the web page screen capturing device obtains a page identifier corresponding to the web page screen capturing request, the web page screen capturing device queries a code database, and determines a page code corresponding to the page identifier in the code database.
And step S12, adding html elements of preset element identifiers in the page codes, and storing the page codes and the html elements as page information in an associated manner.
The web page screen capturing device adds html elements of preset element identifications in page codes, the web page screen capturing device takes the page codes and the added html elements as page information, the web page screen capturing device establishes an association relationship between the page codes and the added html elements, and the web page screen capturing device takes the mutually associated page codes and html elements as page information and stores the page information and html elements in a code database.
Step S13, when receiving the page loading request, loading the page information corresponding to the page identifier, and determining whether the html element of the preset element identifier exists in the loaded page information.
when the web page screen capturing device receives a page loading request, the web page screen capturing device loads page information corresponding to a page identifier from a code database, and the web page screen capturing device judges whether html elements of preset element identifiers exist in the loaded page information in real time, wherein the preset element identifiers refer to preset element identifiers, for example, the preset element identifiers are phantom rendersign.
Step S14, if there is no html element of the preset element identifier in the loaded page information, determining that the loading of the page information corresponding to the page identifier is not completed.
And if the html element of the preset element identifier does not exist in the loaded page information, the web page screen capturing device judges that the page information corresponding to the page identifier is not completely loaded, and the web page screen capturing device continues to load.
Step S15, if there is an html element of the preset element identifier in the loaded page information, determining that the page information corresponding to the page identifier is completely loaded.
If the html element of the preset element identifier exists in the loaded page information, the web page screen capturing device judges that the page information corresponding to the page identifier is completely loaded, so that the web page screen capturing device calculates the actual size of the web page corresponding to the page identifier according to the loaded page information.
In the embodiment, the html element of the preset element identifier is added in the page code by the web page screen capturing device, when the page information is loaded, the html element is generated, and the web page screen capturing device can determine that the page information is loaded, so that the web page screen capturing device does not need to wait for a long time when loading the page information according to the judgment, the loading time of the page information is shortened, and the screen capturing efficiency of the web page screen capturing device is further improved.
That is, there is no way to judge when data is loaded, so that a time waiting for data loading must be set, the time is tested for many times, about 10 minutes is a safe time, and 10 minutes of data must be loaded, but this means that it is necessary to wait for 10 minutes to perform the next screenshot operation when screenshot is performed on a web page, and this time may also be set to be shorter, but there is a risk that a page is empty because data is not loaded yet when a preview image is generated. In the embodiment, the method for adding the html element with the preset element identifier in the page code is used, the html element is generated when the data loading is completed, and the data can be determined to be loaded completely as long as the element is detected, so that the preview image can be generated immediately after the element is present according to the judgment basis, and the preview image does not need to wait for 10 minutes, thereby greatly improving the efficiency.
Further, based on the second embodiment of the web page screen capturing method of the present invention, a third embodiment of the web page screen capturing method of the present invention is provided.
The present embodiment is a refinement of step S20 in the first embodiment, and a specific implementation manner for calculating the actual size of the web page is provided in the present embodiment, and includes:
when the loading of the page information corresponding to the page identifier is completed, obtaining an html element of a preset element identifier in the page information;
and calculating the total element size of the sitting element adjacent to the html element by taking the html element as a starting point, and taking the total element size as the actual size of the web page corresponding to the page identifier.
When the web page screen capture equipment finishes loading the page information, the web page screen capture equipment acquires html elements of preset element identifiers in the page information; the web page screen capturing device takes an html element with a preset element identifier as a starting point, the web page screen capturing device obtains the sitting elements adjacent to the html element and the element sizes of the sitting elements, the web page screen capturing device accumulates the element sizes to obtain the total element size, and the web page screen capturing device takes the total element size as the actual size of the web page corresponding to the page identifier.
For example, the web page screen capturing device uses html element as a starting point to calculate the maximum width and height of the sitting element adjacent to the html element to obtain the actual size of the web page, it can be understood that if the page information does not have the phantom rendersign element, the web page screen capturing device can only perform screen capturing operation in the default screen size, and the screen capturing mode is not limited in that: the web page has more vacant parts, the information size with substantial content is probably far smaller than the screen size, and then a large blank appears after the screen capture image is generated, so that the display effect is influenced; or the actual size of the web page is larger than the screen size of the web page screen capture device, then there is no way to display the extra content in its entirety.
In this embodiment, the web page screen capturing device quickly calculates the actual size of the web page according to the html element of the preset element identifier in the page information, so that the web page screen capturing device can perform screen capturing operation according to the calculated actual size.
Further, based on the above embodiment of the web page screen capturing method of the present invention, a fourth embodiment of the web page screen capturing method of the present invention is provided.
This embodiment is a step after step S30 in the first embodiment, and is different from the above-described embodiments in that:
when a screen capture image sharing instruction is received, acquiring a user identifier corresponding to the screen capture image sharing instruction;
and storing the screen capture image to a target path, generating link information corresponding to the target path, and sending the link information to a client corresponding to the user identifier.
The web page screen capturing device receives the screen capturing sharing instruction, the triggering mode of the screen capturing sharing instruction is not specifically limited, when the web page screen capturing device receives the screen capturing image sharing instruction, the web page screen capturing device obtains a user identifier corresponding to the screen capturing image sharing instruction, and the user identifier refers to identification information of a user, for example, a user account in instant messaging software.
The web page screen capturing device calls a preset data storage interface, the screen capturing image is stored to the target path through the preset data storage interface, the web page screen capturing device generates link information corresponding to the target path, and the web page screen capturing device sends the link information to a client corresponding to the user identification, so that the user determines a target path through the link information to view the screen capturing image.
In the embodiment, the web page screen capturing device stores the screen capturing image in the target path through the preset data storage interface and generates the link information of the target path, so that the user accesses the target path through the link information to obtain the screen capturing image, and the operation of the user is facilitated. It can be understood that the web page screen capture device can also directly send the screen capture image to the client corresponding to the user identifier, so that the user views the screen capture image.
Further, based on the above embodiment of the web page screen capturing method of the present invention, a fifth embodiment of the web page screen capturing method of the present invention is provided.
This embodiment is a step after step S30 in the first embodiment, and is different from the above-described embodiments in that:
when a mail sending request triggered based on the screen capture image is received, acquiring a receiver identification corresponding to the mail sending request;
and adding the screenshot image to a mail interface corresponding to the mail sending request, generating a mail containing the screenshot image and sending a client corresponding to the recipient identification.
That is, when the web page screen capturing device receives a mail sending request triggered based on the screen capturing image, the web page screen capturing device obtains a recipient identifier corresponding to the mail sending request (the recipient identifier is recipient mailbox account information); and the web page screen capturing device adds the screen capturing image to a mail interface corresponding to the mail sending request to generate a mail containing the screen capturing image, and the web page screen capturing device sends the mail containing the screen capturing image to a client corresponding to the identification of the receiver so as to enable the receiver to view the mail.
In the embodiment, after the screen capture is completed, the web page screen capture device sends the captured image obtained by the screen capture as the mail content to the client, so that the recipient can conveniently view the captured image.
In addition, this embodiment may be further combined with the fourth embodiment of the present invention, when the web page screen capturing device receives a mail sending request triggered based on the screen capturing image, the web page screen capturing device stores the screen capturing image to the target path and generates link information corresponding to the target path, and the web page screen capturing device sends the link information to the client corresponding to the recipient identifier as a mail.
Further, based on the above embodiment of the web page screen capturing method of the present invention, a sixth embodiment of the web page screen capturing method of the present invention is provided.
The embodiment mainly aims at sending screenshot images by mails, and the difference between the embodiment and the fifth embodiment is that a user obtains the screenshot images by screenshot on a web page, the user triggers mail operation based on the screenshot images, and the web page screenshot equipment sends the obtained screenshot images as mail contents; in the embodiment, the user triggers the screen capturing request on the mail interface, and the web page screen capturing device performs the screen capturing operation according to the mail interface information. Specifically, the method comprises the following steps:
when an image adding request triggered based on a mail interface is received, a page identification corresponding to the image adding request is obtained, and a web page screen capturing request is triggered based on the page identification.
The method comprises the steps that a user starts a mailbox application program on web page screen capturing equipment, the type of the mailbox application program is not limited, namely the mailbox application program can be Outlook, foxmail, an ios/Android client with a common version model, enterprise WeChat, a webpage end and the like, a mail interface is displayed in a display interface of the web page screen capturing equipment, the user triggers an image adding request on the mail interface, and the triggering mode is not specifically limited; when the web page screen capturing device receives an image adding request triggered based on a mail interface, the web page screen capturing device obtains a page identifier corresponding to the image adding request.
After the web page screen capturing device obtains the page identifier, the web page screen capturing request is triggered based on the page identifier, namely, the web page screen capturing device queries a web page corresponding to the page identifier and jumps to the web page to trigger the web page screen capturing request.
When a web page screen capture request is received, a page identifier corresponding to the web page screen capture request is obtained, and page information corresponding to the page identifier is loaded.
when the web page screen capturing equipment receives a web page screen capturing request triggered based on the page identifier, the web page screen capturing equipment loads page information corresponding to the page identifier; for example, the page identifier is page address information, and the web page screen capturing device queries a preset page code library to obtain page information corresponding to the page address information, so as to complete loading of the page information corresponding to the page identifier.
When the loading of the page information corresponding to the page identifier is completed, calculating the actual size of the web page corresponding to the page identifier according to the page information;
acquiring the interface size of the mail interface, calculating the ratio of the interface size to the actual size, and taking the ratio as the scaling corresponding to the web page screen capturing request;
rendering the page according to the actual size and the scaling corresponding to the web page screen capture request;
and adding the screen shot image to the mail interface, generating a mail containing the screen shot image and sending the mail.
When the web page screen capturing device finishes loading the page information corresponding to the page identifier, the web page screen capturing device calculates the actual size of the web page corresponding to the page identifier according to the page information; the method comprises the steps that web page screen capturing equipment obtains the interface size of a mail interface and calculates the ratio of the interface size to the actual size, the web page screen capturing equipment takes the ratio as the scaling corresponding to a web page screen capturing request, and the web page screen capturing equipment carries out page rendering according to the actual size and the scaling corresponding to the web page screen capturing request; and adding the screenshot image to a mail interface, generating a mail containing the screenshot image and sending the mail.
The current mail system can only add the screen capture image saved in advance, but in the embodiment, the mail interface can be jumped to the web page in real time, and the screen capture image matched with the mail interface is captured from the web page, so that the operation of a user is more convenient and faster, and meanwhile, the screen capture image can be well displayed on the mail interface.
In addition, it can be understood that, in this embodiment, when the page information is loaded, the scaling may be determined without calculating a ratio between the interface size and the actual size, and the screenshot image rendering is performed directly according to the interface size of the mail interface, specifically:
and when the loading of the page information corresponding to the page identifier is finished, acquiring the interface size of the mail interface.
The web page screen capturing device detects the loading state of the page information of the page identifier in real time to judge whether the page information corresponding to the page identifier is loaded completely, and when the web page screen capturing device detects that the page information corresponding to the page identifier is loaded completely, the web page screen capturing device obtains the interface size of the mail interface.
And rendering a page according to the interface size to generate a screen capture image, adding the screen capture image to the mail interface, generating a mail containing the screen capture image and sending the mail.
The web page screen capturing equipment carries out page rendering according to the size of the interface to generate a screen capturing image, adds the screen capturing image to the mail interface, generates a mail containing the screen capturing image and sends the mail; specifically, the method comprises the following steps:
the web page screen capturing device uses an html mail format, controls content typesetting of a mail by using a table tag (because if the table tag is not used, the problem that content cannot be continuously displayed on some mobile phone clients can occur), and also processes different heights and widths of screen capturing images, for example, when the actual size of the screen capturing image is larger than the interface size, the web page screen capturing device calculates the integral multiple of the interface size (rounding up) of the current actual size, and then equally divides the screen capturing image into the blocks. Therefore, the screenshot size with the actual size larger than the interface size can be adapted, so that the screenshot image can be displayed in the mail in a friendly way, and the problem of truncation or dislocation caused by overlarge screenshot image is avoided; and the problem that when the actual size of the screenshot image is larger than the interface size, the screenshot image can be directly cut off and the excessive part is not displayed in an outlook mailbox is avoided. In the embodiment, the web page screen capture is performed according to the interface size of the mail, so that the screen capture image is adapted to a plurality of mail systems, and the mail corresponding to the screen capture image can be well displayed on the plurality of mail systems.
Referring to fig. 5, an embodiment of the present invention further provides a web page screen capturing apparatus, where the web page screen capturing apparatus includes:
the request receiving module 10 is configured to, when a web page screenshot request is received, obtain a page identifier corresponding to the web page screenshot request, and load page information corresponding to the page identifier;
the size calculation module 20 is configured to calculate, according to the page information, an actual size of the web page corresponding to the page identifier when the loading of the page information corresponding to the page identifier is completed;
and the image generating module 30 is configured to perform page rendering according to the actual size and the scaling corresponding to the web page screen capture request, and generate a screen capture image.
In one embodiment, the request receiving module 10 includes:
the code acquisition unit is used for acquiring a page identifier corresponding to a web page screen capturing request and determining a page code corresponding to the page identifier when the web page screen capturing request is received;
the element adding unit is used for adding an html element with a preset element identifier in the page code, and storing the page code and the html element as page information in a correlated manner;
the loading judging unit is used for loading the page information corresponding to the page identifier when a page loading request is received, and judging whether html elements with preset element identifiers exist in the loaded page information or not;
the first judging unit is used for judging that the page information corresponding to the page identifier is not loaded completely if the html element of the preset element identifier does not exist in the loaded page information;
and the second judging unit is used for judging that the page information corresponding to the page identifier is completely loaded if the html element of the preset element identifier exists in the loaded page information.
In one embodiment, the size calculation module 20 includes:
the element obtaining unit is used for obtaining html elements of preset element identifiers in the page information when the page information corresponding to the page identifiers is loaded;
and the size calculation unit is used for calculating the total element size of the sitting element adjacent to the html element by taking the html element as a starting point, and taking the total element size as the actual size of the web page corresponding to the page identifier.
In one embodiment, the web page screen capturing apparatus includes:
the window output module is used for outputting a scale setting prompt so that a user can set the scaling of the screenshot image based on the scale setting prompt;
the scale acquisition module is used for acquiring a scaling input based on the scale setting prompt and taking the scaling as the scaling corresponding to the web page screen capturing request;
the image generating module 30 is further configured to calculate a product of the actual size and the scaling, use the product as a display size, and perform page rendering according to the display size to generate a screen capture image.
In one embodiment, the web page screen capturing apparatus includes:
the instruction receiving module is used for acquiring a user identifier corresponding to the screen capturing image sharing instruction when the screen capturing image sharing instruction is received;
and the link generation module is used for storing the screen capture image to a target path, generating link information corresponding to the target path and sending the link information to the client corresponding to the user identifier.
In one embodiment, the web page screen capturing apparatus includes:
the identification acquisition module is used for acquiring a receiver identification corresponding to the mail sending request when the mail sending request triggered based on the screen capture image is received;
and the mail sending module is used for adding the screen capture image to a mail interface corresponding to the mail sending request, generating a mail containing the screen capture image and sending the client corresponding to the recipient identification.
In one embodiment, the web page screen capturing apparatus includes:
the image adding module is used for acquiring a page identifier corresponding to an image adding request when the image adding request triggered based on a mail interface is received, and triggering a web page screen capturing request based on the page identifier;
the acquisition and calculation module is used for acquiring the interface size of the mail interface, calculating the ratio of the interface size to the actual size, and taking the ratio as the scaling corresponding to the web page screen capturing request;
the image generation module is used for rendering the page according to the actual size and the scaling corresponding to the web page screen capture request;
and the image sending module is used for adding the screen capture image to the mail interface, generating a mail containing the screen capture image and sending the mail.
The method executed by each program module can refer to each embodiment of the web page screen capturing method of the present invention, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. 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 system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a server device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A web page screen capturing method is characterized by comprising the following steps:
when a web page screen capturing request is received, acquiring a page identifier corresponding to the web page screen capturing request, and loading page information corresponding to the page identifier;
when the loading of the page information corresponding to the page identifier is completed, calculating the actual size of the web page corresponding to the page identifier according to the page information;
and rendering the page according to the actual size and the scaling corresponding to the web page screen capture request to generate a screen capture image.
2. The web page screen capturing method according to claim 1, wherein the step of obtaining the page identifier corresponding to the web page screen capturing request and loading the page information corresponding to the page identifier when receiving the web page screen capturing request includes:
when a web page screen capturing request is received, acquiring a page identifier corresponding to the web page screen capturing request, and determining a page code corresponding to the page identifier;
adding html elements with preset element identifiers in the page codes, and storing the page codes and the html elements as page information in a correlated manner;
when a page loading request is received, loading page information corresponding to the page identifier, and judging whether html elements of preset element identifiers exist in the loaded page information or not;
if the html element of the preset element identification does not exist in the loaded page information, judging that the page information corresponding to the page identification is not loaded;
and if the html element of the preset element identifier exists in the loaded page information, judging that the page information corresponding to the page identifier is completely loaded.
3. The web page screen capturing method according to claim 1, wherein the step of calculating the actual size of the web page corresponding to the page identifier according to the page information when the loading of the page information corresponding to the page identifier is completed includes:
when the loading of the page information corresponding to the page identifier is completed, obtaining an html element of a preset element identifier in the page information;
and calculating the total element size of the sitting element adjacent to the html element by taking the html element as a starting point, and taking the total element size as the actual size of the web page corresponding to the page identifier.
4. The web page screen capture method of claim 1, wherein the step of rendering the page according to the actual size and the scaling corresponding to the web page screen capture request and generating the screen capture image is preceded by the step of:
outputting a scale setting prompt for a user to set a scaling of the screenshot image based on the scale setting prompt;
acquiring a scaling input based on the scale setting prompt, and taking the scaling as a scaling corresponding to the web page screen capturing request;
the step of rendering the page according to the actual size and the scaling corresponding to the web page screen capture request to generate the screen capture image comprises the following steps:
and calculating the product of the actual size and the scaling, taking the product as the display size, and rendering the page according to the display size to generate the screen capture image.
5. The method for web page screen capture as claimed in any one of claims 1 to 4, wherein the step of performing page rendering according to the actual size and the scaling corresponding to the web page screen capture request, and generating the screen capture image comprises:
when a screen capture image sharing instruction is received, acquiring a user identifier corresponding to the screen capture image sharing instruction;
and storing the screen capture image to a target path, generating link information corresponding to the target path, and sending the link information to a client corresponding to the user identifier.
6. The method for web page screen capture as claimed in any one of claims 1 to 4, wherein the step of performing page rendering according to the actual size and the scaling corresponding to the web page screen capture request, and generating the screen capture image comprises:
when a mail sending request triggered based on the screen capture image is received, acquiring a receiver identification corresponding to the mail sending request;
and adding the screenshot image to a mail interface corresponding to the mail sending request, generating a mail containing the screenshot image and sending a client corresponding to the recipient identification.
7. The web page screen capturing method according to claim 1, wherein before the step of obtaining the page identifier corresponding to the web page screen capturing request and loading the page information corresponding to the page identifier when the web page screen capturing request is received, the method comprises:
when an image adding request triggered based on a mail interface is received, acquiring a page identifier corresponding to the image adding request, and triggering a web page screen capturing request based on the page identifier;
after the step of calculating the actual size of the web page corresponding to the page identifier according to the page information when the loading of the page information corresponding to the page identifier is completed, the method comprises the following steps:
acquiring the interface size of the mail interface, calculating the ratio of the interface size to the actual size, and taking the ratio as the scaling corresponding to the web page screen capturing request;
rendering the page according to the actual size and the scaling corresponding to the web page screen capture request;
and adding the screen shot image to the mail interface, generating a mail containing the screen shot image and sending the mail.
8. A web page screen capture apparatus, the web page screen capture apparatus comprising:
the request receiving module is used for acquiring a page identifier corresponding to a web page screen capturing request and loading page information corresponding to the page identifier when the web page screen capturing request is received;
the size calculation module is used for calculating the actual size of the web page corresponding to the page identifier according to the page information when the loading of the page information corresponding to the page identifier is completed;
and the image generation module is used for rendering the page according to the actual size and the scaling corresponding to the web page screen capture request to generate a screen capture image.
9. A web page screen capture device, the web page screen capture device comprising: a memory, a processor and a web page screen capture program stored on the memory and executable on the processor, the web page screen capture program when executed by the processor implementing the steps of the web page screen capture method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a web page screen capture program, which when executed by a processor implements the steps of the web page screen capture method of any one of claims 1 to 7.
CN201910959926.6A 2019-10-10 2019-10-10 Web page screen capturing method, device, equipment and computer readable storage medium Pending CN110704784A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910959926.6A CN110704784A (en) 2019-10-10 2019-10-10 Web page screen capturing method, device, equipment and computer readable storage medium
PCT/CN2020/117821 WO2021068765A1 (en) 2019-10-10 2020-09-25 Web page screenshot method and apparatus, device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910959926.6A CN110704784A (en) 2019-10-10 2019-10-10 Web page screen capturing method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110704784A true CN110704784A (en) 2020-01-17

Family

ID=69200127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910959926.6A Pending CN110704784A (en) 2019-10-10 2019-10-10 Web page screen capturing method, device, equipment and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN110704784A (en)
WO (1) WO2021068765A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324263A (en) * 2020-01-21 2020-06-23 维沃移动通信有限公司 Screen capture method, electronic equipment and computer readable storage medium
CN111428162A (en) * 2020-03-20 2020-07-17 支付宝(杭州)信息技术有限公司 Page screenshot method and device
WO2021068765A1 (en) * 2019-10-10 2021-04-15 深圳前海微众银行股份有限公司 Web page screenshot method and apparatus, device, and computer-readable storage medium
CN112948737A (en) * 2021-03-15 2021-06-11 亿海蓝(北京)数据技术股份公司 HTML page screenshot method and system
CN113382083A (en) * 2021-06-30 2021-09-10 建信金融科技有限责任公司 Webpage screenshot method and device
CN113590564A (en) * 2021-07-29 2021-11-02 挂号网(杭州)科技有限公司 Data storage method and device, electronic equipment and storage medium
WO2022174655A1 (en) * 2021-02-19 2022-08-25 华为技术有限公司 Long page screenshot capturing method and electronic device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6907576B2 (en) * 2002-03-04 2005-06-14 Microsoft Corporation Legibility of selected content
CN102708540A (en) * 2012-04-21 2012-10-03 上海量明科技发展有限公司 Method and client side for zooming screen capturing areas
CN107748644A (en) * 2017-11-20 2018-03-02 珠海市魅族科技有限公司 A kind of sectional drawing display methods and equipment, terminal and readable storage medium storing program for executing
CN110704784A (en) * 2019-10-10 2020-01-17 深圳前海微众银行股份有限公司 Web page screen capturing method, device, equipment and computer readable storage medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021068765A1 (en) * 2019-10-10 2021-04-15 深圳前海微众银行股份有限公司 Web page screenshot method and apparatus, device, and computer-readable storage medium
CN111324263A (en) * 2020-01-21 2020-06-23 维沃移动通信有限公司 Screen capture method, electronic equipment and computer readable storage medium
CN111324263B (en) * 2020-01-21 2021-09-03 维沃移动通信有限公司 Screen capture method, electronic equipment and computer readable storage medium
CN111428162A (en) * 2020-03-20 2020-07-17 支付宝(杭州)信息技术有限公司 Page screenshot method and device
WO2021184896A1 (en) * 2020-03-20 2021-09-23 支付宝(杭州)信息技术有限公司 Page screenshot method and device
WO2022174655A1 (en) * 2021-02-19 2022-08-25 华为技术有限公司 Long page screenshot capturing method and electronic device
CN114968423A (en) * 2021-02-19 2022-08-30 华为技术有限公司 Long-page screen capturing method and electronic equipment
CN112948737A (en) * 2021-03-15 2021-06-11 亿海蓝(北京)数据技术股份公司 HTML page screenshot method and system
CN113382083A (en) * 2021-06-30 2021-09-10 建信金融科技有限责任公司 Webpage screenshot method and device
CN113590564A (en) * 2021-07-29 2021-11-02 挂号网(杭州)科技有限公司 Data storage method and device, electronic equipment and storage medium
CN113590564B (en) * 2021-07-29 2024-03-01 挂号网(杭州)科技有限公司 Data storage method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2021068765A1 (en) 2021-04-15

Similar Documents

Publication Publication Date Title
CN110704784A (en) Web page screen capturing method, device, equipment and computer readable storage medium
CN107515764B (en) Application page opening method, terminal and computer readable storage medium
EP2854372B1 (en) Method and device for displaying pushed information
KR101472397B1 (en) Mobile terminal and method for processing notification information
WO2018103676A1 (en) Scanning method, device and terminal
US20160337290A1 (en) Message Push Method and Apparatus
CN107679214B (en) Link positioning method, device, terminal and computer readable storage medium
CN106469044B (en) Method and device for realizing page jump
CN105630525B (en) Page synchronization method and device
CN107463563B (en) Information service processing method and device of browser
CN107329976B (en) Webpage paging method and device, computer equipment and computer readable storage medium
CN110705243A (en) Web page table setting method, device, equipment and computer storage medium
CN112748827A (en) Screenshot sharing method and device, terminal equipment and storage medium
CN111125153A (en) Object management method, device, client and medium
CN111090589A (en) Software testing method, software testing device and readable storage medium
CN115017428A (en) Information display method, device, system and storage medium
CN109710436B (en) Space cleaning method, device, equipment and computer readable storage medium
CN111061637B (en) Interface testing method, interface testing device and storage medium
CN111026669B (en) Test log management method, test log management device and storage medium
CN106776261B (en) Object testing method and device
CN109543166B (en) House property poster template generation method, server and computer readable storage medium
KR20160032653A (en) Method and apparatus for ranking candiate character and method and device for inputting character
CN103617299A (en) Method and system for setting table attribute
CN111144077B (en) View information deleting method, device, equipment and computer readable storage medium
EP2477380A1 (en) Apparatus and method for providing and executing content

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