perf(#26): optimize ScrapingBee — render_js=false, session_id, ai_selector, usage monitoring#27
Merged
Merged
Conversation
…selector, usage monitoring
… to use HTML parsing (remove broken AI path)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #26
Changes
render_js=false (5 → 1 credit per page, 80% saving)
Kickstarter's
/discover/advancedis server-side rendered. Switching torender_js=falsedrops cron crawl from 5 credits/page to 1 credit/page.session_id per (sort × category) crawl
All pages for the same category crawl share a single proxy IP for up to 5 minutes, reducing the chance of Kickstarter rate-limiting between pages.
ai_selector="[data-project]" for AI search
Focuses AI extraction only on project card elements, reducing token processing overhead.
Credit usage monitoring at startup
On service start, logs current monthly credit consumption and warns if ≥ 80% consumed.
New public API
ScrapingBeeClient.FetchHTMLInSession(ctx, url, sessionID)— 1 credit, sticky IPScrapingBeeClient.FetchUsage(ctx)— returns UsageResultKickstarterScrapingService.LogUsage()— logs usage with warning thresholdDiscoverCampaignssignature addssessionID intparam