Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteFor a website that needs real browser rendering, use Python with Playwright and Chromium: open the URL, wait for the page, then call page.pdf(). Playwright uses print CSS by default; use page.emulate_media(media="screen") first if you want screen styling instead. For simpler pages that fit its renderer, WeasyPrint can convert a URL directly. The India qualifier does not change these documented steps; the cited tool documentation does not establish India-specific legal rules for saving arbitrary web pages.
Choose a Python approach
| Approach | Choose it when | Trade-off |
|---|---|---|
| Playwright with Chromium | The page depends on browser rendering or you need browser PDF controls. | Install the Python package and browser binaries. PDFs use print CSS unless you select screen media. |
| WeasyPrint | A direct HTML URL-to-PDF conversion fits the page. | Its resource access needs care, especially when processing untrusted HTML or CSS. |
| Requests | You need to fetch HTTP content as one part of a larger pipeline. | Requests handles HTTP, but is not by itself a browser renderer or URL-to-PDF converter. |
For browser-style pages, start with Playwright. For either route, inspect the output: a PDF is a rendering, not a guarantee that every live interaction, delayed asset, or page behavior will be captured.
Convert a URL with Playwright and Chromium
Install Playwright and its browser
Install the package and download the browser binaries from a terminal:
python -m pip install playwright
playwright install chromium
Playwright’s Python guide documents installation with the playwright package and playwright install; Playwright supports Chromium, Firefox, and WebKit. This example installs Chromium specifically. See the Playwright Python library guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
Save a page as a PDF
Save this as url_to_pdf.py, replacing the example address with the page you need:
import asyncio
from pathlib import Path
from playwright.async_api import async_playwright
async def main():
url = "https://example.com"
output = Path("page.pdf")
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
response = await page.goto(url, wait_until="networkidle", timeout=60000)
if response and not response.ok:
raise RuntimeError(f"Page returned HTTP {response.status}: {url}")
await page.pdf(path=str(output), format="A4", print_background=True)
await browser.close()
print(f"Saved {output.resolve()}")
asyncio.run(main())
Run it with python url_to_pdf.py. The output path is relative to the directory from which you run the script. The status check surfaces an HTTP error response; it does not establish that all assets loaded or that the rendered page is complete.
Rank #2
Print CSS versus screen CSS
page.pdf() generates a PDF using print CSS by default. That means print-specific styles can hide navigation or reflow content. If you want the screen layout, select screen media before generating the PDF:
await page.emulate_media(media="screen")
await page.pdf(path="page.pdf", format="A4", print_background=True)
Playwright documents this behavior in its Python Page API. Choose the media mode based on the layout you actually want to preserve.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteConvert a URL directly with WeasyPrint
When the page is suitable for WeasyPrint’s renderer, its direct URL-to-PDF API is concise:
from weasyprint import HTML
HTML("https://example.com").write_pdf("page.pdf")
Install WeasyPrint using the instructions for your operating system in its First Steps documentation; system dependencies may be required. This method does not run a full interactive browser, so choose Playwright if the page depends on browser behavior.
Protect server-side conversions
WeasyPrint warns that untrusted HTML or CSS and unrestricted access to local or remote resources can create security risks. If your application accepts URLs or markup from users, constrain resource access and avoid letting submitted content read local files or reach internal network resources. Treat URL conversion as an input-security boundary, not just a formatting task.
Where Requests fits—and where it does not
Python Requests can fetch HTTP content, but its documentation describes HTTP requests rather than browser rendering or PDF generation. Use it when fetching is one stage in a pipeline, not as a complete converter for pages whose output depends on rendered browser content. Its documentation covers features such as timeouts and content decoding: Requests documentation.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Best Value
Troubleshoot incomplete or failed PDFs
- Playwright says the browser executable is missing: run
playwright install chromiumin the same environment where the package is installed. - Navigation times out: check that the URL is reachable from the machine running Python. A page that continuously makes network requests may not reach
networkidle; trywait_until="load"and add a targeted wait for the content you need rather than assuming the page is ready. - The PDF layout differs from the browser: print CSS is the default for
page.pdf(). Usepage.emulate_media(media="screen")when screen styling is the goal, then inspect the result. - Images or other assets are missing: the page may load them late, block automated access, or rely on browser behavior. Check the page in the same environment and verify the PDF rather than treating a completed call as proof that every asset was included.
- WeasyPrint cannot fetch a resource or output looks different: check the URL and resource access allowed to the process, and confirm the page is suitable for its renderer. Do not relax security restrictions broadly for untrusted input.
- The PDF is not where expected: use an absolute output path or check the process working directory; the sample Playwright script writes
page.pdfthere.
Or skip the browser setup
If you prefer a hosted screenshot/PDF API, ScreenshotNeo accepts a URL in one request and can return a PDF. Cookie banners are accepted and removed before capture, along with known newsletter popups and chat widgets; those cleanup steps can be switched off. Bot checks, blank pages and failed loads are never billed, and the response identifies the page verdict and billing status. Its MCP server lets AI agents use screenshot tools. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000.
For API setup and options, see the ScreenshotNeo documentation. A Python request looks like this:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
timeout=90,
)
r.raise_for_status()
open("shot.pdf", "wb").write(r.content)
Use an API key from your account; check the requested output settings in the documentation if you need to specify PDF behavior. Sign up for ScreenshotNeo to get 1,000 free screenshots a month with no card.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools




