CN113591003A - Webpage processing method and device, computer equipment and storage medium - Google Patents
Webpage processing method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113591003A CN113591003A CN202110879477.1A CN202110879477A CN113591003A CN 113591003 A CN113591003 A CN 113591003A CN 202110879477 A CN202110879477 A CN 202110879477A CN 113591003 A CN113591003 A CN 113591003A
- Authority
- CN
- China
- Prior art keywords
- current webpage
- content
- picture
- target picture
- webpage
- 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
- 238000003860 storage Methods 0.000 title claims abstract description 23
- 238000003672 processing method Methods 0.000 title description 10
- 238000012545 processing Methods 0.000 claims abstract description 46
- 238000000034 method Methods 0.000 claims abstract description 41
- 238000006243 chemical reaction Methods 0.000 claims abstract description 39
- 238000004590 computer program Methods 0.000 claims description 18
- 238000005096 rolling process Methods 0.000 claims description 13
- 238000005520 cutting process Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000004044 response Effects 0.000 description 2
- 230000003321 amplification Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- 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/957—Browsing optimisation, e.g. caching or content distillation
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention discloses a method and a device for processing a webpage, computer equipment and a storage medium. The method comprises the following steps: acquiring a picture conversion instruction of a user based on a current webpage; then responding to the image conversion instruction, and determining whether the current webpage has overflow content; if the overflow content exists in the current webpage, generating a target picture according to a source code of the current webpage; if the overflow content does not exist in the current webpage, screen capturing processing is carried out on the current webpage to obtain a target picture; and finally, displaying the target picture on the upper layer of the current webpage. In the scheme, the picture corresponding to the current webpage can be generated, so that the user can browse the content on the corresponding webpage through the picture, the picture is not provided with the jump link, the problem that the displayed content jumps to other pages due to the fact that the user mistakenly touches the jump link is avoided, and the stability of the webpage displayed by the terminal and the webpage browsing experience of the user are improved.
Description
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and an apparatus for processing a web page, a computer device, and a storage medium.
Background
Nowadays, almost all terminals (such as mobile phones) support the internet access function, and convenience is brought to life and work of people. The user can surf the internet at any time and any place through the terminals and inquire required information in the browser.
However, other jump links often exist in the searched web page content, a user drags the web page through a touch screen or a mouse to perform sliding search on the web page, or when the display screen of the terminal is kept in a normally-bright state by clicking the web page, the jump link in the content is frequently clicked due to false touch, so that the displayed content jumps to other pages, and at the moment, the user still returns to browse the page before the false touch, so that in the prior art, when the user searches the web page content, the web page displayed by the terminal is often unstable due to false touch.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing a webpage, computer equipment and a storage medium, which can improve the stability of the webpage displayed by a terminal.
In a first aspect, an embodiment of the present invention provides a method for processing a web page, including:
acquiring a picture conversion instruction of a user based on a current webpage;
responding to the image conversion instruction, and determining whether the current webpage has overflow content;
if the overflow content exists in the current webpage, generating a target picture according to a source code of the current webpage;
if the overflow content does not exist in the current webpage, screen capturing is carried out on the current webpage to obtain the target picture;
and displaying the target picture on the upper layer of the current webpage.
In a second aspect, an embodiment of the present invention further provides a device for processing a web page, where the device includes:
the acquisition unit is used for acquiring a picture conversion instruction of a user based on a current webpage;
the determining unit is used for responding to the picture conversion instruction and determining whether the current webpage page has overflow content or not;
the generating unit is used for generating a target picture according to the source code of the current webpage when the overflow content exists in the current webpage;
the screen capturing unit is used for performing screen capturing processing on the current webpage to obtain the target picture when no overflow content exists in the current webpage;
and the display unit is used for displaying the target picture on the upper layer of the current webpage.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, the computer program including program instructions, which when executed by a processor, implement the above method.
The embodiment of the invention provides a method and a device for processing a webpage, computer equipment and a storage medium. Wherein the method comprises the following steps: acquiring a picture conversion instruction of a user based on a current webpage; then responding to the image conversion instruction, and determining whether the current webpage has overflow content; if the overflow content exists in the current webpage, generating a target picture according to a source code of the current webpage; if the overflow content does not exist in the current webpage, screen capturing processing is carried out on the current webpage to obtain a target picture; and finally, displaying the target picture on the upper layer of the current webpage. In the scheme, the picture corresponding to the current webpage can be generated, so that the user can browse the content on the corresponding webpage through the picture, the picture is not provided with the jump link, the problem that the displayed content jumps to other pages due to the fact that the user mistakenly touches the jump link is avoided, and the stability of the webpage displayed by the terminal and the webpage browsing experience of the user are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a processing method of a web page according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for processing a web page according to an embodiment of the present invention;
fig. 3 is a schematic sub-flow chart of a processing method of a web page according to an embodiment of the present invention;
fig. 4 is another schematic sub-flow chart of a processing method of a web page according to an embodiment of the present invention;
fig. 5 is another schematic sub-flow chart of a method for processing a web page according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a device for processing a web page according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a device for processing a web page according to another embodiment of the present invention; and
FIG. 8 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
The embodiment of the invention provides a method and a device for processing a webpage, computer equipment and a storage medium.
The execution main body of the web page processing method may be the web page processing device provided in the embodiment of the present invention, or a computer device integrated with the web page processing device, where the web page processing device may be implemented in a hardware or software manner, the computer device may be a terminal, and the terminal may be a smart phone, a tablet computer, a palm computer, or a notebook computer.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a processing method for a web page according to an embodiment of the present invention. The method for processing the web page is applied to the terminal 10 in fig. 1, a user is browsing the web page using the terminal 10, in order to avoid mistakenly touching a jump link in the web page when browsing, therefore, the currently browsed webpage needs to be converted into a picture for browsing, at this time, the user triggers a picture conversion instruction of the terminal 10 (for example, double-clicking a certain area of the webpage, such as the upper right corner), after the terminal 10 acquires the picture conversion instruction of the user, it is further determined whether the current webpage has overflow content, if the overflow content exists, generating a target picture according to the source code of the current webpage page, if the overflow content does not exist, and finally, displaying the target picture on the uppermost layer of the current webpage so that the user can browse the current webpage through the target picture.
The following describes in detail a processing method of a web page in this embodiment, where the following embodiment takes a terminal as an execution subject, and fig. 2 is a schematic flow chart of the processing method of a web page provided in the embodiment of the present invention. As shown in fig. 2, the method includes the following steps S110-150.
110. And acquiring a picture conversion instruction of a user based on the current webpage.
In this embodiment, a monitoring js (javascript) script code is preset in the terminal, so that when a user browses a webpage in the terminal, whether the user triggers a picture conversion instruction is monitored in real time.
The picture conversion instruction may be customized by a user, for example, when a browser browses a web page, the user may trigger the picture conversion instruction by pressing the screen, or may trigger the picture conversion instruction by double-clicking a certain area (for example, the upper right corner) of the screen, or the like.
In this embodiment, when a user browses a current webpage, a jump link is found to exist on the webpage, and the jump link is easily touched by mistake during browsing, so that the user jumps to other pages, and the browsing experience of the user is poor. Or the user finds that the content of the page is not completely displayed, some content overflows out of the screen, the user can browse all the content of the current webpage only by dragging the screen transversely and/or dragging the screen longitudinally, the user cannot check the whole situation at the same time, and the screen cannot display all the content visually, so that the user is difficult to acquire the conditions of summarization, structure and the like of the content, the user wants to convert the current webpage into a picture without a jump link and overflowing content for browsing, and at the moment, the user triggers a picture conversion instruction, so that the terminal acquires the picture conversion instruction.
In some embodiments, after the picture conversion instruction of the user based on the current webpage is obtained, picture conversion prompt information is generated to prompt the user whether the user needs to perform picture conversion on the area, if the user needs to feed back the user, step S120 is executed, and if the user does not need to feed back the user, the next picture conversion instruction continues to be monitored.
120. Responding to the image conversion instruction, determining whether the current webpage has overflow content, if so, executing step S130, and if not, executing step S140.
And the current webpage is a webpage which needs to be browsed by the current user.
When the terminal acquires a picture conversion instruction of a user, the terminal responds to the picture conversion instruction and determines whether overflow content exists in the current webpage.
Wherein in some embodiments, the overflow content refers to only lateral overflow content (content that requires lateral sliding to be seen), and in other embodiments, the overflow content includes lateral overflow content as well as vertical overflow content (content that requires vertical sliding to be seen).
In some embodiments, referring to fig. 3, step S120 includes:
s121, determining whether the source code has the rolling label, if so, executing step S122, and if not, executing step S123.
In this embodiment, if a scroll tag exists in the source code, it indicates that content that needs to be scrolled to be displayed exists in the current webpage, and at this time, it indicates that overflow content exists in the current webpage.
When the overflow content only refers to the transverse overflow content, the scroll label comprises a transverse scroll label, and when the overflow content comprises the transverse overflow content and the longitudinal overflow content, the scroll label comprises a transverse scroll label and a longitudinal scroll label.
And S122, determining that the overflow content exists in the current webpage.
When the overflow content only refers to the horizontal overflow content, the overflow content exists in the current webpage, that is, the content which can be acquired only by the user sliding the screen horizontally exists in the current webpage, and when the overflow content includes the horizontal overflow content and the vertical overflow content, the overflow content exists in the current webpage, that is, the content which can be acquired only by the user sliding the screen horizontally and/or vertically exists in the current webpage.
And S123, determining that no overflow content exists in the current webpage.
When the overflow content only refers to the horizontal overflow content, the current webpage page does not have the overflow content, which indicates that the content needing horizontal sliding does not exist in the current webpage page but the content needing vertical sliding may exist (at this time, the content which can be acquired through vertical sliding does not belong to the overflow content), and when the overflow content includes the horizontal overflow content and the vertical overflow content, the current page does not have the overflow content, which indicates that the content which can be acquired through horizontal sliding and vertical sliding does not exist in the current webpage page, that is, the content displayed by the current webpage page is the whole webpage content.
In other embodiments, referring to fig. 4, step S120 includes:
and B121, acquiring the actual size of the current webpage from the source code.
The actual size of the current web page is the size of all contents of the current web page (including screen contents displayed on a screen and overflow contents not displayed on the screen).
In some embodiments, when the overflow content refers to only lateral overflow content, the actual size only includes an actual lateral actual size, which is an actual length of the lateral content of the current webpage page; in other embodiments, when the overflow content includes horizontal overflow content and vertical overflow content, the actual size includes a horizontal actual size and a vertical actual size, and the vertical actual size is an actual length of the vertical content of the current webpage page.
In some embodiments, the specific step of obtaining the actual size of the current webpage from the source code includes: the method comprises the steps of presetting a JS script code with the size capable of obtaining the actual size of a current webpage, accessing a source code of the current webpage through the JS script code with the size, determining the size of displayed content according to the source code, and determining the size of the displayed content as the actual size.
B122, determining whether the actual size is larger than the page size of the current webpage, if so, executing step B123, and if not, executing step B124.
The page size of the current webpage is the size of the webpage content which can be displayed in the display screen of the current terminal, and the size of the overflow content is not included.
In some embodiments, the page size includes a horizontal page size when overflow content refers only to horizontal overflow content, and in other embodiments, the page size includes a horizontal page size and a vertical page size when overflow content includes horizontal overflow content and vertical overflow content.
At this time, in some embodiments, when the overflow content only refers to the lateral overflow content, step B122 specifically includes: and judging whether the transverse actual size is larger than the transverse page size.
In other embodiments, when the overflow content includes horizontal overflow content and vertical overflow content, step B122 specifically includes: judging whether the transverse actual size is larger than the transverse page size or not to obtain a first judgment result; judging whether the longitudinal actual size is larger than the longitudinal page size or not to obtain a second judgment result; and determining whether the overflow content exists according to the first judgment result and the second judgment result.
And B123, determining that the overflow content exists in the current webpage.
When the overflow content only refers to transverse overflow content, determining that the overflow content exists in the current webpage when the transverse actual size is judged to be larger than the transverse page size; when the overflow content comprises transverse overflow content and longitudinal overflow content, determining that the overflow content exists in the current webpage when the first judgment result is true or the second judgment result is true.
And B124, determining that no overflow content exists in the current webpage.
When the overflow content only refers to transverse overflow content, when the transverse actual size is judged to be not larger than the transverse page size, determining that no overflow content exists in the current webpage; when the overflow content comprises horizontal overflow content and vertical overflow content, and the first judgment result is not satisfied and the second judgment result is not satisfied, determining that the overflow content exists in the current webpage.
130. And generating a target picture according to the source code of the current webpage.
If the overflow content exists in the current webpage, the target picture needs to be generated according to the source code of the current webpage at the moment.
In some embodiments, step S130 includes: acquiring a source code through a preset JS script code; and then determining page display content according to the source code, and generating a target picture according to the page display content. The method comprises the steps of generating a target picture according to page display content, wherein the page display content is converted into base64 data; and then setting the base64 data in a preset picture layout control to generate a target picture, wherein the base64 is one of encoding modes of 8-Bit byte codes.
When the source code is an H5 page code, the picture layout control comprises a container control (WebView) and an ImageView control, when a user browses webpage contents, the ImageView control is hidden, but if an instruction that the current webpage page needs to be converted into a picture is monitored, page display contents are converted into base64 data, the base64 data are displayed on the ImageView control, at the moment, the ImageView control is in a display state, the container control is hidden, and if the user cancels to display the picture corresponding to the current webpage page, the ImageView control is hidden and the container control displays.
In some embodiments, the generated target picture has the same horizontal size as the horizontal page size displayed on the screen, and the vertical size and the horizontal size of the target picture are adjusted in equal ratio.
In other embodiments, the generated target picture needs to be displayed on the screen all at the same time, at this time, when the vertical size of the target picture is larger than the vertical page size, at this time, the vertical size of the target picture needs to be adjusted to the vertical page size all the time, and at this time, the horizontal size and the vertical size of the target picture are adjusted in equal ratio.
140. And performing screen capture processing on the current webpage to obtain a target picture.
In some embodiments, referring to fig. 5, step S140 includes:
and S141, calling a preset screenshot tool to perform screenshot processing on the current webpage to obtain a screenshot picture.
The preset screenshot tool can be a screenshot tool carried by the terminal system, the screenshot tool can be used for intercepting all contents currently displayed on the current webpage, and the screenshot picture in the embodiment includes all contents currently displayed on the current webpage.
And S142, cutting the screen shot picture according to the preset size to obtain the target picture.
In this embodiment, the preset size is a page size of the terminal, where the page content is actually displayed, and the target picture acquired in this embodiment needs to be removed from a specific function region (for example, a region of top display time, electric quantity, top website, and the like) of the terminal, so that the screenshot picture needs to be cut according to the preset size, the function region is cut, the content displayed on the current webpage is left, and the reading experience of the user is improved.
The processing speed of the terminal for obtaining the target picture by carrying out screen capture processing on the current webpage is higher than that of generating the target picture through the source code.
150. And displaying the target picture on the upper layer of the current webpage.
In this embodiment, after the target picture is generated, the target picture needs to be displayed on the uppermost layer of the current webpage page, so that a user can preview the content in the current webpage page through the target picture.
Because the user browses the current webpage through the target picture and the jump link does not exist in the target picture, the situation that the user jumps to other pages due to mistakenly touching the jump link can be avoided, and the browsing experience of the user is improved.
In this embodiment, after the target picture is displayed on the upper layer of the current webpage, the method further includes: receiving a picture adjusting instruction of a user for a target picture; and controlling the target picture according to the picture adjusting instruction, namely after the target picture is generated, the user can enlarge or reduce the target picture and can also move or rotate the target picture.
In this embodiment, after the user views the web page content globally through the target picture of the whole content displayed on the screen, the user can preview the summary or structure of the content quickly, and the user can quickly locate the area to be read by performing an amplification operation on the target area, so as to further improve the reading experience of the user, where the target area is an area that the user needs to browse currently.
In this embodiment, after the terminal generates the target picture, the target picture is placed in the cache, the converted tag is marked on the webpage corresponding to the target picture, and when the user needs to perform picture conversion on the same webpage again in the following process, the corresponding target picture can be directly called from the cache according to the converted tag, wherein when the user exits from the current webpage, the cache is cleaned, and the operation content of the user can be prevented from being seen after the user takes the terminal.
In the embodiment, the terminal acquires a picture conversion instruction of a user based on a current webpage; then responding to the image conversion instruction, and determining whether the current webpage has overflow content; if the overflow content exists in the current webpage, generating a target picture according to a source code of the current webpage; if the overflow content does not exist in the current webpage, screen capturing processing is carried out on the current webpage to obtain a target picture; and finally, displaying the target picture on the upper layer of the current webpage. In the scheme, the picture corresponding to the current webpage can be generated, so that the user can browse the content on the corresponding webpage through the picture, the picture is not provided with the jump link, the problem that the displayed content jumps to other pages due to the fact that the user mistakenly touches the jump link is avoided, and the stability of the webpage displayed by the terminal and the webpage browsing experience of the user are improved.
Fig. 6 is a schematic block diagram of a device for processing a web page according to an embodiment of the present invention. As shown in fig. 6, the present invention also provides a device for processing a web page, corresponding to the above method for processing a web page. The processing device of the webpage comprises a unit for executing the processing method of the webpage, and the device can be configured in a desktop computer, a tablet computer, a portable computer and other terminals. Specifically, referring to fig. 6, the apparatus for processing a web page includes an obtaining unit 601, a determining unit 602, a generating unit 603, a screen capturing unit 604, and a displaying unit 605, where:
an obtaining unit 601, configured to obtain a picture conversion instruction of a user based on a current webpage;
a determining unit 602, configured to determine, in response to the picture conversion instruction, whether overflow content exists in the current webpage page;
a generating unit 603, configured to generate a target picture according to a source code of the current webpage when the current webpage has overflow content;
a screen capture unit 604, configured to perform screen capture processing on the current webpage to obtain the target picture when no overflow content exists in the current webpage;
a display unit 605, configured to display the target picture on an upper layer of the current webpage.
In some embodiments, the determining unit 602 is specifically configured to:
determining whether a rolling tag is present in the source code;
if the source code has the rolling label, determining that the current webpage page has overflow content;
and if the source code does not have the rolling label, determining that the overflow content does not exist in the current webpage.
In some embodiments, the determining unit 602 is further specifically configured to:
acquiring the actual size of the current webpage from the source code;
judging whether the actual size is larger than the page size of the current webpage or not;
if the actual size is larger than the page size of the current webpage, determining that the current webpage has overflow content;
and if the actual size is not larger than the page size of the current webpage, determining that no overflow content exists in the current webpage.
In some embodiments, the generating unit 603 is specifically configured to:
acquiring the source code through a preset JS script code;
determining page display content according to the source code;
and generating the target picture according to the page display content.
In some embodiments, the generating unit 603 is further specifically configured to:
converting the page display content to base64 data;
and setting the base64 data in a preset picture layout control to generate the target picture.
In some embodiments, the screen capture unit 604 is specifically configured to:
calling a preset screenshot tool to perform screenshot processing on the current webpage to obtain a screenshot picture;
and cutting the screen shot picture according to a preset size to obtain the target picture.
Fig. 7 is a schematic block diagram of a device for processing a web page according to another embodiment of the present invention. As shown in fig. 7, the processing apparatus of the web page of the present embodiment is the processing apparatus of the above embodiment, which is additionally provided with a receiving unit 606 and a control unit 607, wherein:
a receiving unit 606, configured to receive a picture adjustment instruction for the target picture from a user;
a control unit 607, configured to control the target picture according to the picture adjustment instruction.
In this embodiment, the obtaining unit 601 obtains a picture conversion instruction of a user based on a current webpage; then, in response to the image conversion instruction, the determining unit 602 determines whether there is overflow content in the current webpage; if the current webpage has overflow content, the generating unit 603 generates a target picture according to the source code of the current webpage; if the current webpage does not have overflow content, the screen capture unit 604 performs screen capture processing on the current webpage to obtain a target picture; finally, the display unit 605 displays the target picture on the upper layer of the current web page. In the scheme, the picture corresponding to the current webpage can be generated, so that the user can browse the content on the corresponding webpage through the picture, the picture is not provided with the jump link, the problem that the displayed content jumps to other pages due to the fact that the user mistakenly touches the jump link is avoided, and the stability of the webpage displayed by the terminal and the webpage browsing experience of the user are improved.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation processes of the processing apparatus and each unit of the web page may refer to the corresponding descriptions in the foregoing method embodiments, and for convenience and brevity of description, no further description is provided herein.
The processing means of the above-mentioned web page may be implemented in the form of a computer program which can be run on a computer device as shown in fig. 8.
Referring to fig. 8, fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device 800 may be a terminal, wherein the terminal may be an electronic device with a web browsing function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. Referring to fig. 8, the computer device 800 includes a processor 802, memory and network interface 805 connected by a system bus 801, wherein the memory may include a non-volatile storage medium 803 and an internal memory 804.
The non-volatile storage medium 803 may store an operating system 8031 and computer programs 8032. The computer program 8032 includes program instructions that, when executed, cause the processor 802 to perform a method for processing a web page.
The processor 802 is used to provide computing and control capabilities to support the operation of the overall computer device 800.
The internal memory 804 provides an environment for the operation of the computer program 8032 in the non-volatile storage medium 803, and when the computer program 8032 is executed by the processor 802, the processor 802 can be caused to execute a method for processing a web page.
The network interface 805 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 8 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 800 to which aspects of the present invention may be applied, and that a particular computing device 800 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 802 is configured to execute a computer program 8032 stored in the memory to implement the steps of:
acquiring a picture conversion instruction of a user based on a current webpage;
responding to the image conversion instruction, and determining whether the current webpage has overflow content;
if the overflow content exists in the current webpage, generating a target picture according to a source code of the current webpage;
if the overflow content does not exist in the current webpage, screen capturing is carried out on the current webpage to obtain the target picture;
and displaying the target picture on the upper layer of the current webpage.
In an embodiment, when the processor 802 implements the step of determining whether the current webpage page has overflow content, the following steps are specifically implemented:
determining whether a rolling tag is present in the source code;
if the source code has the rolling label, determining that the current webpage page has overflow content;
and if the source code does not have the rolling label, determining that the overflow content does not exist in the current webpage.
In an embodiment, when the processor 802 implements the step of determining whether the current webpage page has overflow content, the following steps are specifically implemented:
acquiring the actual size of the current webpage from the source code;
judging whether the actual size is larger than the page size of the current webpage or not;
if the actual size is larger than the page size of the current webpage, determining that the current webpage has overflow content;
and if the actual size is not larger than the page size of the current webpage, determining that no overflow content exists in the current webpage.
In an embodiment, when the processor 802 implements the step of generating the target picture according to the source code of the current webpage, the following steps are specifically implemented:
acquiring the source code through a preset JS script code;
determining page display content according to the source code;
and generating the target picture according to the page display content.
In an embodiment, when the processor 802 implements the step of generating the target picture according to the page display content, the following steps are specifically implemented:
converting the page display content to base64 data;
and setting the base64 data in a preset picture layout control to generate the target picture.
In an embodiment, when the processor 802 implements the step of performing the screen capturing process on the current webpage to obtain the target picture, the following steps are specifically implemented:
calling a preset screenshot tool to perform screenshot processing on the current webpage to obtain a screenshot picture;
and cutting the screen shot picture according to a preset size to obtain the target picture.
In an embodiment, after the step of displaying the target picture on the upper layer of the current webpage is implemented, the processor 802 further implements the following steps:
receiving a picture adjusting instruction of a user aiming at the target picture;
and controlling the target picture according to the picture adjusting instruction.
It should be understood that in embodiments of the present invention, the Processor 802 may be a Central Processing Unit (CPU), and the Processor 802 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program comprises program instructions. The program instructions, when executed by the processor, cause the processor to perform the steps of:
acquiring a picture conversion instruction of a user based on a current webpage;
responding to the image conversion instruction, and determining whether the current webpage has overflow content;
if the overflow content exists in the current webpage, generating a target picture according to a source code of the current webpage;
if the overflow content does not exist in the current webpage, screen capturing is carried out on the current webpage to obtain the target picture;
and displaying the target picture on the upper layer of the current webpage.
In an embodiment, when the processor executes the program instructions to implement the step of determining whether the current webpage page has overflow content, the following steps are specifically implemented:
determining whether a rolling tag is present in the source code;
if the source code has the rolling label, determining that the current webpage page has overflow content;
and if the source code does not have the rolling label, determining that the overflow content does not exist in the current webpage.
In an embodiment, when the processor executes the program instructions to implement the step of determining whether the current webpage page has overflow content, the following steps are specifically implemented:
acquiring the actual size of the current webpage from the source code;
judging whether the actual size is larger than the page size of the current webpage or not;
if the actual size is larger than the page size of the current webpage, determining that the current webpage has overflow content;
and if the actual size is not larger than the page size of the current webpage, determining that no overflow content exists in the current webpage.
In an embodiment, when the processor executes the program instruction to implement the step of generating the target picture according to the source code of the current webpage, the following steps are specifically implemented:
acquiring the source code through a preset JS script code;
determining page display content according to the source code;
and generating the target picture according to the page display content.
In an embodiment, when the processor executes the program instructions to implement the step of generating the target picture according to the page display content, the following steps are specifically implemented:
converting the page display content to base64 data;
and setting the base64 data in a preset picture layout control to generate the target picture.
In an embodiment, when the processor executes the program instruction to implement the step of performing the screen capturing process on the current webpage to obtain the target picture, the following steps are specifically implemented:
calling a preset screenshot tool to perform screenshot processing on the current webpage to obtain a screenshot picture;
and cutting the screen shot picture according to a preset size to obtain the target picture.
In an embodiment, after executing the program instructions to implement the step of displaying the target picture on the upper layer of the current webpage, the processor further implements the following steps:
receiving a picture adjusting instruction of a user aiming at the target picture;
and controlling the target picture according to the picture adjusting instruction.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for processing a web page, comprising:
acquiring a picture conversion instruction of a user based on a current webpage;
responding to the image conversion instruction, and determining whether the current webpage has overflow content;
if the overflow content exists in the current webpage, generating a target picture according to a source code of the current webpage;
if the overflow content does not exist in the current webpage, screen capturing is carried out on the current webpage to obtain the target picture;
and displaying the target picture on the upper layer of the current webpage.
2. The method of claim 1, wherein the determining whether overflow content exists in the current webpage page comprises:
determining whether a rolling tag is present in the source code;
if the source code has the rolling label, determining that the current webpage page has overflow content;
and if the source code does not have the rolling label, determining that the overflow content does not exist in the current webpage.
3. The method of claim 1, wherein the determining whether overflow content exists in the current webpage page comprises:
acquiring the actual size of the current webpage from the source code;
judging whether the actual size is larger than the page size of the current webpage or not;
if the actual size is larger than the page size of the current webpage, determining that the current webpage has overflow content;
and if the actual size is not larger than the page size of the current webpage, determining that no overflow content exists in the current webpage.
4. The method of claim 1, wherein generating a target picture according to the source code of the current webpage comprises:
acquiring the source code through a preset JS script code;
determining page display content according to the source code;
and generating the target picture according to the page display content.
5. The method of claim 4, wherein the generating the target picture according to the page display content comprises:
converting the page display content to base64 data;
and setting the base64 data in a preset picture layout control to generate the target picture.
6. The method of claim 1, wherein the performing the screen capture process on the current webpage to obtain the target picture comprises:
calling a preset screenshot tool to perform screenshot processing on the current webpage to obtain a screenshot picture;
and cutting the screen shot picture according to a preset size to obtain the target picture.
7. The method according to any one of claims 1 to 6, wherein after the target picture is displayed on the upper layer of the current webpage, the method further comprises:
receiving a picture adjusting instruction of a user aiming at the target picture;
and controlling the target picture according to the picture adjusting instruction.
8. An apparatus for processing a web page, comprising:
the acquisition unit is used for acquiring a picture conversion instruction of a user based on a current webpage;
the determining unit is used for responding to the picture conversion instruction and determining whether the current webpage page has overflow content or not;
the generating unit is used for generating a target picture according to the source code of the current webpage when the overflow content exists in the current webpage;
the screen capturing unit is used for performing screen capturing processing on the current webpage to obtain the target picture when no overflow content exists in the current webpage;
and the display unit is used for displaying the target picture on the upper layer of the current webpage.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program comprising program instructions which, when executed by a processor, implement the method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110879477.1A CN113591003A (en) | 2021-07-30 | 2021-07-30 | Webpage processing method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110879477.1A CN113591003A (en) | 2021-07-30 | 2021-07-30 | Webpage processing method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113591003A true CN113591003A (en) | 2021-11-02 |
Family
ID=78253551
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110879477.1A Pending CN113591003A (en) | 2021-07-30 | 2021-07-30 | Webpage processing method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113591003A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116701791A (en) * | 2023-07-20 | 2023-09-05 | 国信蓝桥教育科技股份有限公司 | Course recommendation method and system based on artificial intelligence |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103365862A (en) * | 2012-03-28 | 2013-10-23 | 北京百度网讯科技有限公司 | Method and equipment for generating pictures corresponding to pages |
CN103997487A (en) * | 2014-05-04 | 2014-08-20 | 绿网天下(福建)网络科技有限公司 | Safe network-surfing isolation method based on browser |
CN106446617A (en) * | 2016-09-21 | 2017-02-22 | 河南科技大学 | Static webpage access method with active file protection function |
WO2020048189A1 (en) * | 2018-09-07 | 2020-03-12 | 北京三快在线科技有限公司 | Image generation |
CN112051954A (en) * | 2020-10-12 | 2020-12-08 | 展讯通信(天津)有限公司 | Page fixing display method and device, electronic equipment and storage medium |
-
2021
- 2021-07-30 CN CN202110879477.1A patent/CN113591003A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103365862A (en) * | 2012-03-28 | 2013-10-23 | 北京百度网讯科技有限公司 | Method and equipment for generating pictures corresponding to pages |
CN103997487A (en) * | 2014-05-04 | 2014-08-20 | 绿网天下(福建)网络科技有限公司 | Safe network-surfing isolation method based on browser |
CN106446617A (en) * | 2016-09-21 | 2017-02-22 | 河南科技大学 | Static webpage access method with active file protection function |
WO2020048189A1 (en) * | 2018-09-07 | 2020-03-12 | 北京三快在线科技有限公司 | Image generation |
CN112051954A (en) * | 2020-10-12 | 2020-12-08 | 展讯通信(天津)有限公司 | Page fixing display method and device, electronic equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116701791A (en) * | 2023-07-20 | 2023-09-05 | 国信蓝桥教育科技股份有限公司 | Course recommendation method and system based on artificial intelligence |
CN116701791B (en) * | 2023-07-20 | 2023-10-20 | 国信蓝桥教育科技股份有限公司 | Course recommendation method and system based on artificial intelligence |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9436772B2 (en) | Appending a uniform resource identifier (URI) fragment identifier to a uniform resource locator (URL) | |
CN105335071A (en) | Method and device for displaying page elements | |
KR20110091379A (en) | Method and apparatus for selecting hyperlinks | |
JP2013508807A (en) | Method and apparatus for generating an internet navigation page | |
CN112685671A (en) | Page display method, device, equipment and storage medium | |
TW201327225A (en) | Browser and method for displaying subsites | |
CN110659092A (en) | Webpage screenshot method and device, computer equipment and storage medium | |
TW201501016A (en) | Data searching method and electronic apparatus thereof | |
CN113392358A (en) | Static resource preloading method and device | |
CN111813468A (en) | Method and device for shielding webpage operation and electronic equipment | |
US10895962B2 (en) | Apparatus and method for facilitating browser navigation | |
CN113591003A (en) | Webpage processing method and device, computer equipment and storage medium | |
US20130055114A1 (en) | Enhanced and Extended Browsing Via Companion Mobile Device | |
CN108038150B (en) | Webpage opening method and device and terminal equipment | |
WO2016110259A1 (en) | Content acquiring method and apparatus, and user equipment | |
CN106970848B (en) | Input control method and device and electronic equipment | |
WO2015079527A1 (en) | Information processing device, information processing method, and information processing program | |
CN112287261A (en) | Resource loading method and electronic equipment | |
US20060104276A1 (en) | Dynamic hover text for HTML table cells | |
TWI489370B (en) | System and method for rendering widget | |
JP7206863B2 (en) | Display control method, device, and program | |
JP2012181693A (en) | Web page display control device and scroll control method | |
WO2016107871A1 (en) | Adaptive method for device independent web page presentation | |
CN109948086B (en) | Webpage data processing method and device, storage medium and computer equipment | |
JP2012173946A (en) | Web page display device and focus control method |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20211102 |