Change your project's starting value

Under the "Settings" tab of your project you can change the starting value.

You can use this text box to:

  • Add a bunch of urls in JSON for ParseHub to crawl through
  • Add keywords that you want ParseHub to enter into a search box
  • Add usernames and passwords that ParseHub will enter into a log-in screen
  • Add multiple values for one set of data

Tutorial:

In this example we will enter hypothetical movie urls into ParseHub and also add a price that corresponds to each url into the starting value.

1. Open ParseHub and add in the following url - https://www.parsehub.com/sandbox/welcome2

2. Open the "Settings" tab of the project.

3. In the "Starting value" text box enter the following code:

{ "movies": [{ "url": "https://www.parsehub.com/sandbox/moviedetailsimple?movie=The%20Shawshank%20Redemption", "price": "$9.99" }, { "url": "http://192.168.51.10:6643/sandbox/moviedetailsimple?movie=Schindler%27s%20List", "price": "$10.99" }] }
 
4. Click on the + button on the right side of the "Select page" command.
 
5. From the tool box choose the "Loop" tool. The loop tool iterates over a list, and is good for repeating commands multiple times. In this case, we want it to repeat the commands under it for each movie in the starting values.
 
 
7. In the text boxes - leave "item" and type in "movies" in the list text box (without the quotation marks).
  • You can change "item" to anything you want. The item represents one set of url and price combinations in your list of movies.
  • Make sure the the list name is exactly the same as your list name in JSON. If you typed in {"movies":....} make sure to keep the text in the text box as movies.

8. Click on the + button on the right side of the "For each item in movies" command.

9. From the tool box choose the "Begin New Entry" tool. 

10. Rename the "list1" command to something else like "movies." Make sure not to name the Begin new entry command the same as the list that holds your movies. The begin new entry command should have a unique name. 

11. Click on the + button on the right side of the "Begin new entry in movies" command.

12. Choose the "Extract" command from the tool box. This will let you extract anything you put in the text box of the extract command into your results.

13. In the text box beside the dropdown type in "item.price". Now the price you entered in the "Starting value" for each url will be extracted into your results. 

14. Click on the + button on the right side of the "Begin new entry in movies" command or if you didn't rename it the "Begin new entry in list1" command.

15. Choose the "Go To Template" from the tool box. The Go to Template command will let you specify which url you want to go to and which type of page you want to open.

16. On the pop up window choose "Go to URL :" instead of "Stay on the Same Page".

17. In the text box type in "item.url" without quotation marks. Enter the new template's name in the "Create New Template" text box and click on "Create New Template." A new template will open for you with the new url.

 

Have more questions? Submit request!

0 Comments

Article is closed for comments.