Skip to content

Add browser_type / executable_path to MarkdownifyWebScraperDriver - #2230

Draft
feder-cr wants to merge 2 commits into
griptape-ai:mainfrom
feder-cr:add-markdownify-browser-type
Draft

feder-cr wants to merge 2 commits into
griptape-ai:mainfrom
feder-cr:add-markdownify-browser-type

Conversation

@feder-cr

@feder-cr feder-cr commented Jul 2, 2026

Copy link
Copy Markdown

fetch_url was hardcoded to p.chromium.launch(headless=True), so there was no way to point it at a different engine or a custom binary. Adds browser_type (defaults to 'chromium', unchanged behavior) and executable_path fields, following the attrs field pattern already used here. Motivated by invisible_playwright, a Playwright wrapper around a Firefox build patched at the source level for a realistic fingerprint, useful for scrapes that hit bot detection on the default Chromium path. Opened as draft, happy to adjust naming or add a test.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@collindutter collindutter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you please add some unit tests?

@feder-cr

Copy link
Copy Markdown
Author

Added unit tests for the new options: default chromium + headless, executable_path passthrough, and firefox selection. All green locally (12 passed). Thanks for the review.

@feder-cr

Copy link
Copy Markdown
Author

@collindutter friendly bump whenever you have a moment - the unit tests you asked for are in (default chromium + headless, executable_path passthrough, firefox selection; all green locally). No rush, just flagging it is ready for another look.

@collindutter collindutter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor feedback, otherwise looks good!

exclude_classes: list[str] = field(default=Factory(list), kw_only=True)
exclude_ids: list[str] = field(default=Factory(list), kw_only=True)
timeout: int | None = field(default=None, kw_only=True)
browser_type: str = field(default="chromium", kw_only=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some validation here? Maybe replace str with Literal["chromium", "firefox", "webkit"] and add an attr's validator validator=attrs.validators.in_(["chromium", "firefox", "webkit"])?

@feder-cr

feder-cr commented Aug 7, 2026

Copy link
Copy Markdown
Author

@collindutter friendly nudge on this one, still ready to merge whenever you get a chance to look. Let me know if anything else needs changing.

@collindutter

Copy link
Copy Markdown
Member

@collindutter friendly nudge on this one, still ready to merge whenever you get a chance to look. Let me know if anything else needs changing.

@feder-cr did you see my comment here? Please put the PR out of draft status and re-request my review when it's ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants