Skip to content

Conversation

@OEvortex
Copy link
Owner

Summary

  • handle boolean attribute filtering in Tag.find_all

Testing

  • pre-commit (fails: command not found)

@OEvortex OEvortex merged commit aea498c into main May 25, 2025
2 of 3 checks passed
@OEvortex OEvortex requested a review from Copilot May 25, 2025 13:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds explicit support for boolean attribute filters in the tag‐matching logic for Tag.find_all.

  • Introduces a v is True branch to require that the attribute is present.
  • Updates the regex and exact‐match checks to handle missing attributes.
Comments suppressed due to low confidence (2)

webscout/scout/element.py:213

  • Add unit tests for the new boolean‐attribute filtering logic, covering both v=True (attribute must exist) and v=False (attribute must be absent) cases to verify correct behavior.
if v is True:

webscout/scout/element.py:210

  • Update the function docstring (or upstream Tag.find_all docs) to mention support for boolean attribute filters (v=True/v=False) so users know these cases are handled explicitly.
def _match(tag):

if not v.search(str(tag_attr)):
if v is True:
if tag_attr is None:
return False
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

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

The logic does not handle v is False explicitly, so filtering with v=False will fall through to the exact‐match branch and likely reject all tags. Consider adding an elif v is False: branch to exclude tags that have the attribute.

Suggested change
return False
return False
elif v is False:
if tag_attr is not None:
return False

Copilot uses AI. Check for mistakes.
@OEvortex OEvortex deleted the codex/fix-crawling-issue-with-scoutcrawler branch December 1, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants