Measure Page Size of Web Pages (pgsize)
Measure the size of web pages and assets. Analyze page load time. Get insights for website optimization.
Measure Page Size of Web Pages
Purpose
The Measure Page Size of Web Pages function helps you analyze the size of a web page and its assets like images, scripts, and stylesheets. It also provides information on the time taken to load the page.
Use Cases
- To understand the total size of a web page and its assets
- To identify which assets contribute the most to the overall page size
- To monitor the page load time for optimization
How to Use
- Enter the URL of the web page you want to analyze.
- Click on the "Submit" button to start the analysis.
- View the results displayed on the page.
Input Values
- URL: Enter the URL of the web page you want to analyze. (default unit is inch)
Output Values
- Page Size Analysis: Provides a breakdown of the page size and asset sizes in kilobytes (KB).
- Page Load Time (Sec): Shows the time taken to load the web page in seconds.
- Log: Displays any errors that occurred during the analysis process.
Any other Instruction
- Ensure the URL entered is correct and accessible.
- Wait for the analysis to complete before viewing the results.
- Review the asset sizes to identify potential optimization opportunities.
Code Analysis
- Fetch the HTML content of the web page.
- Parse the HTML using BeautifulSoup.
- Find tags that may contain assets like images, scripts, and stylesheets.
- Extract URLs of assets and calculate their sizes.
- Calculate the total size of the web page content and assets.
- Return the sizes of different assets, total size, and page load time.
Technical Parameters
- urls
Return Values
- sizes
- page_load_time
Example Expressions
You can use the following expressions to directly evaluate in a non-interactive manner using eval():
- Calculate page size for a single URL:
pgsize('https://example.com')
- Compare page sizes for multiple URLs:
pgsize('https://example1.com\r\nhttps://example2.com')
Click on Help icon to open the help page on a separate window.