Skip to content

Commit

Permalink
adding small instruction on how to get the selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
eliastor committed Aug 22, 2023
1 parent b7dd279 commit dee3db4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 10 deletions.
23 changes: 17 additions & 6 deletions docs/data-sources/recipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,28 @@ page_title: "chromedp_recipe Data Source - terraform-provider-chromedp"
subcategory: ""
description: |-
Recipe runs list of action sequentially.
If "screenshot_filename" is set it makes the screenshot after all actions executed.
All the actions are list of string where the first string is action name.
In most cases the second string is selector for the action.
If "screenshot_filename" is set it makes the screenshot after all actions executed.
All actions are list of string where the first string is action name.
In most cases the second string is selector for the action.
The easiest way to get the selector for the element:
Open Devtools -> select element in DOM (or right click on the element at page and click "inspect element) -> right click on the element in dev tools: copy -> copy selector.
For more information about selectors https://en.wikipedia.org/wiki/CSS#Selector
---

# chromedp_recipe (Data Source)

Recipe runs list of action sequentially.
If "screenshot_filename" is set it makes the screenshot after all actions executed.
All the actions are list of string where the first string is action name.
In most cases the second string is selector for the action.
If "screenshot_filename" is set it makes the screenshot after all actions executed.

All actions are list of string where the first string is action name.

In most cases the second string is selector for the action.

The easiest way to get the selector for the element:

Open Devtools -> select element in DOM (or right click on the element at page and click "inspect element) -> right click on the element in dev tools: copy -> copy selector.

For more information about selectors https://en.wikipedia.org/wiki/CSS#Selector

## Example Usage

Expand Down
6 changes: 6 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ This providers allows you to use [chromedp](https://github.com/chromedp/chromedp
The easiest way to start using it is to install local Chrome or to create container with headless chrome,
for an instance: `podman run --rm -d -p 3000:3000 docker.io/browserless/chrome:latest`

The easiest way to get the selector for the element:

Open Devtools -> select element in DOM (or right click on the element at page and click "inspect element) -> right click on the element in dev tools: copy -> copy selector.

For more information about selectors https://en.wikipedia.org/wiki/CSS#Selector

## Example Usage

```terraform
Expand Down
16 changes: 12 additions & 4 deletions internal/provider/data_recipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ func (d *RecipeDataSource) Metadata(ctx context.Context, req datasource.Metadata

func (d *RecipeDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: `Recipe runs list of action sequentially.
If "screenshot_filename" is set it makes the screenshot after all actions executed.
All the actions are list of string where the first string is action name.
In most cases the second string is selector for the action.`,
MarkdownDescription: `Recipe runs list of action sequentially.
If "screenshot_filename" is set it makes the screenshot after all actions executed.
All actions are list of string where the first string is action name.
In most cases the second string is selector for the action.
The easiest way to get the selector for the element:
Open Devtools -> select element in DOM (or right click on the element at page and click "inspect element) -> right click on the element in dev tools: copy -> copy selector.
For more information about selectors https://en.wikipedia.org/wiki/CSS#Selector`,
Attributes: map[string]schema.Attribute{
"actions": schema.ListAttribute{
ElementType: types.ListType{
Expand Down
6 changes: 6 additions & 0 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ This providers allows you to use [chromedp](https://github.com/chromedp/chromedp
The easiest way to start using it is to install local Chrome or to create container with headless chrome,
for an instance: `podman run --rm -d -p 3000:3000 docker.io/browserless/chrome:latest`

The easiest way to get the selector for the element:

Open Devtools -> select element in DOM (or right click on the element at page and click "inspect element) -> right click on the element in dev tools: copy -> copy selector.

For more information about selectors https://en.wikipedia.org/wiki/CSS#Selector

## Example Usage

{{ tffile "examples/provider/provider.tf" }}
Expand Down

0 comments on commit dee3db4

Please sign in to comment.