In most cases, ParseHub is able to scrape data from behind pop-up windows. Below is an example of a pop-up that ParseHub is able to scrape data behind.
However, there are some websites where you must close a pop-up before ParseHub is able to scrape your data. In this tutorial, you will learn how to test if the pop-up on your website needs to be closed before scraping your data, and what to do in cases where you do need to close the pop-up.
Testing a pop-up to see if ParseHub can get data from behind it
To test if ParseHub can scrape data from behind a pop-up on your specific website, you should build a simple project that scrapes 1 or 2 piece of information from you website and then test run your project. To follow along with this example, you can visit the Alexia Maria website.
1. Switch to Browse mode by clicking on the toggle next to the project's "Settings" tab.
2. Close the pop-up by clicking on the x in the upper right-hand corner.
3. Switch back to Select mode by clicking on the Browse toggle, and select an element on the page to extract it. For this example, I am just going select one of the categories at the top of the page. Make sure that the selection that you made is producing data in the data preview pane at the bottom of the ParseHub client.
4. Now, test run your project by clicking on "Get Data" at the bottom of the ParseHub client,
then click on "Test Run",
and finally click on the Fast Forward button once the Test Run has opened.
This will let you know if ParseHub is able to scrape data behind the pop-up on the website.
5. Once your test run has finished running, check your data preview pane at the bottom of the ParseHub client. If ParseHub was able to get data from behind the pop-up, data will have been extracted into your data preview pane.
If not, your data preview pane will remain empty.
If your project was able to scrape data from the website and your preview pane had data in it, then you can continue building your project like normal. If not, follow the instructions found below.
Closing a pop-up within your project
As before, we are going to be using the Alexia Maria website for this example. Start off with a brand new project.
1. A Select command should already be placed in your command structure. If not, click on the plus button next to the "Select page" command, and then on the Select command from the toolbox.
2. Using this Select command, click on the x on the pop-up to select it. You can rename this command to something more descriptive by clicking on the command itself. I've named it "closePopup".
3. Click on the plus button next to "Select & Extract closePopup", and choose the Click command from the toolbox.
4. In the Click command's configuration window, answer "No", "Continue executing the Current Template", and then click on the "Stay on Current Template" button at the bottom of the window.
After that is set up, you can continue building your project as normal.