Click tabs, buttons and product variants

Suitable interactions

  • Product color, size or material options.
  • Tabs that replace or reveal content.
  • Accordion panels.
  • Buttons that load an additional set of records.

Check whether a click is required

Before adding an Element click selector for a tab, variant or similar control, check whether the value is already present in the page HTML. Many websites render the content for all states and use the click only to change what is visible.

  1. Click the tab or control manually so the target value is visible.
  2. Create or identify the selector for the value you want to extract.
  3. Reload the page so it returns to its original state.
  4. Run Data preview for the value selector without clicking the tab or control.

If Data preview returns the value, the click is not required for extraction. Use the value selector directly. Only add an Element click selector when the target value is unavailable in the original page state and is added or changed only after the interaction.

Avoiding unnecessary clicks reduces sitemap complexity and usually makes scraping faster and more stable because the scraper does not need to execute and wait for an interaction on every page.

Configure the selector

  1. Create an Element click selector.
  2. Define the scope in which the clickable elements should be found. Select the page HTML element for page-level clicks, or use *_parent_* when the click occurs within records created by a parent Element selector.
  3. Select the controls that should be clicked.
  4. Choose whether each control should be clicked once or repeatedly.
  5. Configure click-element uniqueness if needed.
  6. Leave the default delay unless the dependent content needs more time to load or update after the click.
  7. Add selectors for the data you want to extract after the click. Place them as children of the Element click selector when extracting data for each clicked state, or after the Element click selector when the click simply reveals or updates a value on the current record.

Initial and clicked values

Choose whether records available before the first click should be retained. Use the discard setting when the initial state would duplicate one of the clicked states or produce an unusable row.

Variant combinations

If a product has multiple variant groups, such as size and color, test that selecting an option in one group does not reset the option selected in another. Confirm that each intended variant combination is returned as a separate row.

Validation

  • Each click changes the intended value.
  • The selector waits for the update before extraction.
  • Disabled or unavailable options do not create false records.
  • Duplicate initial rows are removed only when appropriate.

Related