Skip to content

Conversation

tech-engine
Copy link
Owner

Added Css & XPath node selectors to response. Now, we can do something like below to extract data from elements.

// get all the matching nodes
resp.Css("article.product_pod h3 a").GetAll()

// get the first matching node
resp.Xpath("//article[contains(@class, 'product_pod')]/h3/a").Get()

// get the text of all matched nodes and it's descendants
resp.Xpath("//article[@class='product_pod']/h3/a").Text()

// chaining
resp.Css("....").Xpath("....").GetAll()

@tech-engine tech-engine merged commit e839e7e into main Sep 3, 2024
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.

1 participant