How to Capture The Search Terms Entered and The Output?Tuesday, May 24, 2016 4:11 AM
Welcome to Octoparse’ s tutorial.
There’s time when you want to capture the search keywords as well as the output of each search. (If you don’t know how to capture data by searching multiple terms on a website, please check out How to Scrape Data by Searching Multiple Keywords on A Website?）
It seems to be a popular request. So I decided to make a video for you guys.
After setting the basic information for the task. Open the home page in the built-in browser.
(The website used in the tutorial: http://www.yellowpages.com/)
Drop an “Loop Item” into the Workflow Designer.
Then select a “loop mode” > Choose “text list”
Enter the terms you want to search. (I search car and hotel.)
Next, click on the search box. Choose “Enter text value”.
Drag “Enter text value” into the “Loop Item” box so that the program will loop to enter the keywords, and automatically search them in the search box.
Then select “Use current loop text to fill the text box”. Then click "save".
Next, capture the term entered. Click the search box and select “Extract value of this item”.
The search item you just captured will be added to the extracted result.
Click search button > choose “Click an item”.
Now we are on the search result page. Start extracting data.
The information I want is on the detail page. So I need to create a list of item to get into that page. Click on the title > Select Create a list a item > Add current item to the list > Continue to edit the list.
Click on the send title > Add current item to the list again. Then click “loop”.
Next, capture the detail information. Click on the data you want and choose “Extract text”.
Now you’ re done configuring the rule of extraction. After running the task on your computer, Octoparse will automatically collect all the data you want. And you will see that the search terms are added to the result. Now, problem solved! Download Octoparse and try it now!