Some pages will only load the data you need after you pick out options in a dropdown, or several dropdowns, from a search page. This tutorial will show you how to search through these options
Selecting one option in a dropdown
To select all the options of a single dropdown on a new template:
1. With an empty Select command, click on the dropdown menu to select it.
2. Another select command should be generated automatically. If not, press the plus button next to selection1 and add it. Click on the first option in the dropdown.
3. Then, click on the second option in the dropdown to train ParseHub to select each result.
4. Press the plus button beside the "Select and Extract option" command and add a Click command. If there is a search button for the options, see step 6. Otherwise, see step 5.
5. If there is no search button, and the results load in automatically, in the popup that appears, choose No, Create a new template, and enter a name for it. Press the green button to add the command. This will cause ParseHub to perform the actions on the new template for each option in the drop-down. You can start selecting and extracting the data you need using this new template.
6. If there is a search button, make sure that your Click command Continues executing the current template. Press the green button to continue.
7. Press the plus button beside the "Select option" command, click on "Advanced", and add a third select command.
8. Click on the search button to select it with the new command.
9. Press the plus button beside the new select command for the search button, and add a Click command.
10. In the popup that appears, choose No, Create New Template, and enter a name for your new template. Press the green button to add the command. This will cause ParseHub to perform the actions on the new template, to scrape data for each search result from the list of options. You can start selecting and extracting the data you need using this new template.
Selecting multiple options in a dropdown
To select all of the options from multiple dropdowns:
1. Follow steps 1–4 for selecting a single dropdown.
2. Instead of going to a new template, make sure that your Click command Continues executing the current template. Click on the green button to continue.
3. Press the plus button beside the "Select option" command, click on "Advanced", and add a new Select command.
4. Follow steps 1–3, for a single dropdown, again for the second dropdown menu. Follow steps 5–10 as needed to bring up the results.
This method can be repeated for as many dropdowns as are on the page. It makes sure that for each option of each option, the results will be brought up for you to scrape in a new template. This will, you will get all possible combinations of results.
Only selecting specific options in a dropdown
After selection each option of a dropdown, but before the Click command, you can add a Conditional command to filter out which options you want to select. Use the conditional expression $e.text.includes("option_you_want") to select one particular option. You can also include ||$e.text.includes("extra_option") afterwards to include any number of extra options to select.
Read our page about ParseHub expressions to figure out how to make a more complicated expression to narrow down your results.