Web Scraping Answers

Specific questions, answered in the first paragraph — with steps, working code and a link to the full guide.

Keeping Canvas and WebGL Output Consistent in Headless Browsers

No. Randomising canvas and WebGL values per page load creates a profile no real device produces, which is itself an automation signal. Pick one coherent profile per session: GPU vendor, renderer, fonts, screen and user agent that agree with each other, and keep it stable. AlterLab manages this coherence for every browser-rendered request.

Checking Proxy Tunnel Health Before Sending Browser Commands

Before each navigation, send a cheap request through the same tunnel, such as a HEAD to a known endpoint, with a short timeout. Only issue the browser command if it succeeds; otherwise mark the exit unhealthy, rotate to a fresh one and retry. AlterLab runs these checks and rotation automatically for every request.

Redundant Cross-Border Proxy Pools That Rotate When Throttled

Group exits by country into pools, score each endpoint on recent success and latency, and route to the best healthy one. Treat HTTP 429, 503 and slow responses as throttling: move that node into a timed cool-down and fail over to the next endpoint in the same country. AlterLab provides this failover across its proxy network automatically.

Matching Request Headers to the Region of Your Exit IP

Accept-Language, browser timezone, locale and currency settings should all match the exit IP's country. A German IP sending en-US headers with a US timezone looks inconsistent. Set them together per request rather than individually. AlterLab's location option routes the request through the chosen country and aligns language and locale for you.

Building an LLM Agent That Writes a Daily Social Feed Digest

Give the agent one tool that fetches a public page and returns clean markdown, then have it summarise the posts into themes, links and notable replies. Keep fetching outside the model: the tool handles rendering and retries, the model only reads text. AlterLab's API and MCP server provide that fetch tool for agent frameworks.

Scraping a Web Page in C# with HtmlAgilityPack

Install the HtmlAgilityPack NuGet package, download the page HTML with HttpClient, load it into an HtmlDocument and select nodes with XPath through SelectNodes or SelectSingleNode. For JavaScript-rendered pages, fetch the rendered HTML from an API such as AlterLab first, then parse it with HtmlAgilityPack exactly the same way.

Web Scraping in Java: Getting TV Show Data from Web Pages

Check for a public API first, such as TVmaze, which returns show data as JSON. If none covers your fields, fetch the page HTML and parse it with jsoup using CSS selectors, then map the results into Java objects. For JavaScript-rendered pages, fetch rendered HTML through AlterLab and parse it with jsoup.

Parsing Instagram's connections.json Followers and Following Files

Request your account data in JSON format, unzip it and open the connections folder. The followers and following files list entries whose string_list_data holds the username in value and a timestamp. Load both with Python's json module, collect the usernames into sets and compare them to find accounts that do not follow back.

The Most Reliable Way to Collect Google Search Results

Use a SERP API instead of sending requests from your own IP. Direct requests get rate limited quickly. A SERP API spreads requests across residential exits, sets country and language consistently, renders when needed and returns structured results. AlterLab's search API returns organic results as JSON, with retries handled for you.

Headless Browser Resource Usage Across Many Sessions

Each full browser instance typically needs 150-500 MB of RAM, plus CPU spikes during rendering. Playwright browser contexts share one browser process, so many isolated sessions cost far less than many browsers. Block images, fonts and media, cap concurrency to available memory and recycle browsers periodically. AlterLab runs this browser fleet for you.

Ruby HTML Parsing Gems Like Cheerio for Node.js

Yes: Nokogiri. Like Cheerio, it parses HTML into a document you query with CSS selectors through css and at_css, and it also supports XPath. Oga is a pure-Ruby alternative without native extensions. Neither runs JavaScript, so fetch rendered HTML from an API such as AlterLab when a page builds its content client-side.

Rate Limiting, Retries, Backoff and Connection Pooling in Python

Use one shared httpx or requests session so connections are pooled, cap concurrency with a semaphore, and retry only on timeouts, 429 and 5xx responses. Wait with exponential backoff plus random jitter, honour Retry-After headers and stop after a few attempts. AlterLab applies the same retry and pacing logic on its side for every request.

Building an AI Agent That Finds the Best Deals on eBay and Jawa

Give the agent a tool that fetches public search result pages and returns structured listings: title, price, shipping, condition and URL. Compute total price in code, compare it with your target price or the median of recent listings, and let the model only rank and explain the shortlist. AlterLab can supply the fetch and extraction step.

Serving JSON Data from GitHub Pages

Commit a .json file to the branch or folder GitHub Pages publishes, for example data/items.json, and fetch it at https://user.github.io/repo/data/items.json. Pages serves it as static content with CORS open to all origins, so browsers can read it directly. Regenerate the file from a scheduled GitHub Action to keep the data fresh.

Cleaning Scraped Pages into Markdown and Chunking Them for RAG

Convert each page to markdown, strip navigation, footers and cookie banners, then split along headings into chunks of roughly 300-800 tokens with a small overlap. Store the URL, title and heading path with every chunk so answers can cite sources. AlterLab can return main-content markdown directly, which removes most of the cleaning step.

Saving an Article's Like and Share Counts to a Database

Fetch the rendered article page, because counters usually load with JavaScript, then select the like and share elements and convert values such as 1.2K into integers. Insert one row per fetch with the URL, counts and timestamp so you can chart change over time. AlterLab returns the rendered page ready for parsing.

Your first scrape.
Sixty seconds.

Up to 5,000 free requests — about 5,000 Light, 500 Protected or 250 Dynamic requests. No credit card.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · Up to 5,000 free requests (about 5,000 Light, 500 Protected or 250 Dynamic requests) · Balance never expires