In this Article
What is a selector?
A selector in the context of web pages is a mechanism used to locate and interact with elements on the page.
Selectors in DubBot
Selectors are used in the following Advanced Configurations for DubBot's Site Settings:
Crawling Behind a Login using Form Authentication Settings
How to Find a CSS Selector
Open the webpage with the content you want to select in a browser.
Right-click in the field or element for which you want to find the selector.
Note: these directions are for Google Chrome, other browsers are similarIn the menu that appears, select Inspect.
When you focus on the item in the regular page view that you want to select, the corresponding code is highlighted in the inspect window.
Select the three dots, or right-click in the selected code area, and select Copy Selector from the menu that appears.
Paste that information into the item's corresponding field in DubBot. The copied selector may look something like the following:
div#popup > button.alert-close
or.alert-close
.
Note: the CSS selector provided using this Copy method may be more detailed than necessary. Selectors for closing out these content sections are highly specific to website implementation. Technical administrators with an understanding of HTML and CSS may be able to simplify the selector input by referencing just the ID or class of the Close element.
How to Use the Copy Selector Tool
The following example walks you through the steps given above to help explain the process of finding the Selector for an HTML element to use in the selector field in DubBot.
Open DubBot's Newsletter Signup form in a browser.
Right-click in the field or element for which you want to find the selector.
This example selects the Name field using Google Chrome on a PC, other browsers are similar.
In the menu that appears, select Inspect. A window will appear to the bottom or left of your browser window, depending on your settings.
When you focus on the item in the regular page view that you want to select, the corresponding code is highlighted in the inspect window.
Select the three dots, or right-click in the selected code area, and select Copy Selector from the menu that appears.
Paste that information into the item's corresponding field in DubBot. The copied selector may look something like the following:
div#popup > button.alert-close
or.alert-close
. In the case of this example, you will find upon pasting the information, that#lastname
has been pasted.
Finding an ID selector from an Element's HTML
For the following source code:
<input class="form-control" id="username" name="t_user" type="text" value="" autofocus="" fdprocessedid="skrvc">
You should enter #username for the Username field selector.
Similarly, for the following source code:
<input class="form-control" id="password" name="t_pass" type="password" value="" fdprocessedid="22xrtz">
You would enter #password for the Password field selector.
For the button, with the following code:
<button class="btn btn-default btn-login" type="submit" name="_eventId_proceed" fdprocessedid="foxb9m">Login</button>
If you have questions, please contact our DubBot Support team via email at help@dubbot.com or via the blue chat bubble in the lower right corner of your screen. We are here to help!