At ParseHub, we normally recommend building separate projects for each website, but in some cases you might need to combine two different websites in one project.
In this tutorial, you will learn how to scrape data from a website and use it as an input for another website.
For this example, we will scrape the Amazon & eBay websites. We will use the Amazon data as inputs to search for the same products on eBay.
Amazon:
1. Click on the + button next to the select page, then choose the Select tool. Next, select the first product title:
2. Select the second product's title (highlighted in yellow) in order to select all the listed products:
3. By selecting all the products, Parsehub creates a Begin New Entry (list) node and extracts the name and the URL of each product. If you are not interested in the URL you can hover on the extract command and remove it.
4. Select the relevant price for each product on the same page. Click on the + button next to the Begin New Entry and choose the Relative Select tool:
eBay:
5. Click on the + button next to the Select page and click on advanced then choose the Go to template tool:
6. Now Parsehub will show you the configuration in a pop up for the Go to template command. Check the box "Go to URL" and enter 'www.ebay.com' with quotations. Now choose the create new template box and create a new template for eBay. Click on the "Create new Template" button. This will open an eBay page in a newly created template.
7. Now we want ParseHub to search the name of the products scraped from Amazon on eBay. Click on the + button next to the Select page in your eBay template and click on advance. Then, choose the Loop tool to create a loop and call the items of "AmazonProducts" list from the main template. In the List field (the second box of the Loop configuration) enter the name of the Amazon products' list (the Begin New Entry command's name) which was "AmazonProducts".
8. Click on the + button next to the loop (For each item in AmazonProducts) in your eBay template and click on advanced then add the Begin new entry command to create a list for the eBay products.
9. Click on the + button next to the Begin new entry and choose the Select tool and click on the eBay search field.
10. In this step, we want to enter one of the products' names from the "AmazonProducts" list. As an expression you can enter item.name to call each item's "name" (the title of the extract command on the main_template) from the "AmazonProducts" list.
11. Click on the + button next to the Begin new entry and choose the Select tool and click on the eBay search button.
12. Change to browse mode and enter one of Amazon's product names into the eBay search field. We will be able to see the function of item.name during the test-run only and it will not call the item from the list while building the project.
Click on the + button next to the searchButton command and add a click command to search for the names scraped from Amazon on eBay. ParseHub will show you the configuration in a pop up for click command; choose "No" and option to create a new template. Now this will open a new template and will load the search results of eBay.
12. We can now extract the data from the eBay search results such as name and price for the same products listed on amazon. In the final results, you will have both Amazon and eBay products along with their prices. This project will allow you to use the final dataset for price comparison purposes.