In this tutorial, we are going to show you how to scrape search results from Google Scholar. Also, the ready-to-use Google Scholar Template has been inserted in our latest version, you may want to check it out here: Task Templates.
If you would like to build the scraper from scratch,you might want to use the URL in this tutorial:
Here are the main steps in this tutorial:[Download task file here]
1)"Go To Web Page" - to open the targeted web page
- Click "+Task" to start a new task with Advanced Mode
- Paste the following URL into the"Extracting URL" box and click "Save URL" to move on
2)Create a "Loop Item"- to loop enter searching keywords
We can customize our "text list" to create a loop search action. Octoparse will automatically enter every keyword in the list into the search box, one line a time.
- Drop a "loop item" action into the workflow designer
- Go to loop mode and select “Text list”
- Click "a" to enter the keywords lists with one keywords per line. Here we'll enter "data mining" and "big data"
- Click "OK" and "OK" when you finish entering. Then you can see your keywords in the "Loop Item"
- Click on the search box on the page in the built-in browser and select “Enter text" on "Action Tips"
When you click on the input field in the built-in browser, Octoparse can detect that you select a search box, the “Enter text” action will automatically appear on “Action tips”.
- Input the first keyword "data mining" on "Action Tips"
- Click "OK", then the"Enter Text" action will be generated in the workflow
- Drag the "Enter Text" action into the "Loop Item". Click on the "Enter Text" action
Go to "Loop Text" and select"Use the text in loop item to fill in the text box” and click “OK” to save.
set up "wait before execution"
- Click the search button of the web page and select “Click button" on "Action Tips", you will notice the "Click Item" action is added into the workflow.
- check "open the link in new tab" and click "Save"
3) Create a pagination loop - to scrape data from multiple listing pages
- Scroll down and click "Next" button
- Click "Loop click next page" on "Action Tips"
4) Create a "Loop Item" -to loop extract each item
We are now on the second page. When creating a "Loop Item", we should always start with the first item on the first page. Thus, we'd better go back to the first page.
- Click "Go To Web Page" in the workflow.
- Click "Loop Item"
- Click “Enter Text"
- Click "Click Item"
- Select the pagination loop in the workflow
By doing this, we can help Octoparse decide the execution order and generate the Loop Item at the appropriate position in the workflow.
- Click the title of the first item in the built-in browser
We need to make sure the whole block of the first video item is covered in blue when you curse over your mouse. Only in this way, we could see the whole item block is highlighted in green after clicking, covering all other information like title, author, date...
- Click the second item
Octoparse will automatically recognize the other items and highlight them in green.
- Click "Select All" on "Action Tips"
- Click " Extract text of the selected element " on "Action Tips" panel.
Normally we can just click "Select all sub-elements" on the "Action Tips" panel, but under certain circumstances (like this case), Octoparse fails to do that. Thus, we’ll create a loop at first, and select the data of each block for extracting manually in the next step.
5) Extract data - to select data you need to scrape
- Click on the Data field
- Click "Delete Data Field"
- Click "Yes”
- Click data you need in the item block which is highlighted in red.
- Click "Extract text of the selected element" and rename the "Field name" column if necessary.
Rename the fields by selecting from the pre-defined list or inputting on your own
- Click "OK" to save the result.
6) Run extraction - to run your task and get data
- Click "start extraction"
- Select "local extraction" to run the task on your computer
Below is the output sample:
Was this article helpful? Contact us anytime if you need our help!