css_extractor
parameter, ZenRows returns structured JSON data instead of raw HTML.Let’s say you want to scrape the title from the ScrapingCourse eCommerce page. The title is contained in an h1
tag.To extract it, send the css_extractor
parameter with the value {"title": "h1"}
. Make sure the parameter is properly encodedh1
mapped to the key “title”. ZenRows extracts the content from the first h1
element and returns it as structured JSON data..product-name
:href
attribute instead of text content, add @href
to your selector.Let’s filter links to only include those starting with /product/
:@href
syntax tells ZenRows to extract the href
attribute value instead of the element’s text content. The [href*='/product/']
part filters links to only include those containing /product/
in their href attribute.This returns: