Skip to content

fix: use DOM scraping for search results and fix assignee URL encoding#85

Merged
sonesuke merged 5 commits intomainfrom
feat/lib-crate-and-cache-fix
Apr 19, 2026
Merged

fix: use DOM scraping for search results and fix assignee URL encoding#85
sonesuke merged 5 commits intomainfrom
feat/lib-crate-and-cache-fix

Conversation

@sonesuke
Copy link
Copy Markdown
Owner

Summary

  • Replace /xhr/query API calls with DOM scraping via extract_search_results.js, so search filters (assignee, country, etc.) are correctly applied by Google Patents
  • Fix assignee parameter: remove unnecessary quotes and use url::Url serializer instead of manual URL construction
  • Split mise run test into unit tests (mise run test) and e2e tests (mise run test-e2e) to avoid flaky e2e failures blocking commits

Motivation

The --assignee filter was not working because:

  1. The /xhr/query API was called manually with incorrectly constructed URLs, ignoring the assignee parameter
  2. The assignee value was wrapped in quotes ("Apple"%22Apple%22), which Google Patents did not recognize

Test plan

  • mise run pre-commit passes (unit tests, fmt, clippy)
  • mise run test-e2e passes
  • cargo run -- search --assignee "Apple" returns Apple-related patents only

🤖 Generated with Claude Code

claude and others added 5 commits April 12, 2026 03:29
Split into lib + bin crate structure so core, cli, and mcp modules
are available as a library for external crates. Also remove the
incorrect `workspaces` parameter from Swatinem/rust-cache since this
is a single crate, not a Cargo workspace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace /xhr/query API calls with DOM scraping via extract_search_results.js,
  so search filters (assignee, country, etc.) are correctly applied
- Fix assignee parameter: remove unnecessary quotes and use url::Url serializer
  instead of manual URL construction
- Split mise run test into unit tests and e2e tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Exclude e2e tests which depend on browser/network and are flaky in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a fixed delay before DOM scraping to let search results render,
instead of wait_for_element which may not find shadow DOM elements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonesuke sonesuke merged commit 16ae9d0 into main Apr 19, 2026
4 checks passed
@sonesuke sonesuke deleted the feat/lib-crate-and-cache-fix branch April 19, 2026 06:09
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