This pull request adds a new function extract_css_selectors to the src/extract_css_selectors.py file. This function uses the selectolax library to extract all CSS selectors from an HTML content.
Summary
Added extract_css_selectors function to src/extract_css_selectors.py
Imported HTMLParser from selectolax.parser
Defined get_css_selector function to retrieve CSS selectors for a given node
Created a set css_selectors to store unique CSS selectors
Iterated through all nodes in the HTML content and added their CSS selectors to the set
Returned a list of all CSS selectors found in the HTML content
Added a sample usage in the if __name__ == "__main__" block to demonstrate the functionality
Fixes #10.
🎉 Latest improvements to Sweep:
We just released a dashboard to track Sweep's progress on your issue in real-time, showing every stage of the process – from search to planning and coding.
Sweep uses OpenAI's latest Assistant API to plan code changes and modify code! This is 3x faster and significantly more reliable as it allows Sweep to edit code and validate the changes in tight iterations, the same way as a human would.
PR Feedback (click)
Description
This pull request adds a new function
extract_css_selectors
to thesrc/extract_css_selectors.py
file. This function uses theselectolax
library to extract all CSS selectors from an HTML content.Summary
extract_css_selectors
function tosrc/extract_css_selectors.py
HTMLParser
fromselectolax.parser
get_css_selector
function to retrieve CSS selectors for a given nodecss_selectors
to store unique CSS selectorsif __name__ == "__main__"
block to demonstrate the functionalityFixes #10.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: