You are browsing a tutorial guide for the latest Octoparse version. If you are running an older version of Octoparse, we strongly recommend you upgrade because it is faster, easier and more robust! Download and upgrade here if you haven't already done so!
Bing Maps is a geospatial mapping platform that allows developers to create applications that layer location-relevant data on top of licensed map imagery.
This tutorial will show you how to scrape business info from Bing Maps.
The URL being used in this tutorial is: https://www.bing.com/maps/
The main steps are shown in the menu on the right, and you can download the sample task file here.
1. Create a Go to Web Page - to open the target website
2. Enter Text - to search for the result
The workflow created should look like this:
Click on Click Item and go to the Options tab.
Untick Open in a new tab for the generated Click Item action
Set AJAX Timeout as 7s
Click Apply
3. Set up a loop click - to extend the detailed card
Click on the first item card, then click on the second item card
Modify Xpath for the Loop to locate all item cards.
Click on the Loop Item frame
Choose Variable List as Loop Mode
Input Xpath as: //li[@data-priority]
Click Apply
Set up Xpath and Ajax timeout for Click Item1
Click Click Item1 in the Loop Item box
Tick Relative Xpath to the Loop Item
Input Xapth as : /a
Click Apply
Click Options
Untick Open in a new tab
Set AJAX Timeout as 10s
Click Apply
4. Extract data - to get the desired data
Click on the data you want on the detailed card
Click Text on the Tips panel
It will take one more click to extract the URL.
Click on Website >A >Link
Modify XPath for the data fields to locate the data in every detailed content card
Turn the Data Preview into a Vertical View
Input XPath as below
tel: //a[contains(@href,"tel:")]
website: //a[@viewname="InstLink"][2]
opentime: //span[@class="opHours"]/span
5. Set up a loop for the images - to extract images on the detailed content card
Create Loop Item 1 under Extract data
Create an Extract data step in Loop Item 1
Click "+" and extract data in Loop Item1
Click on Extract Data1
Click "+" and select Capture data on the page in the data preview section
Click Confirm
Click More> Customize field>Select image URL(src attribute)
Set up download file
Note: For more details on how to set up the download location, please check on this tutorial: Scrape and download files
The final workflow should look like this:
6. Run the task - to get the desired data
Click Run to run your task either on your device or in the cloud
Select Standard Mode under Run on your device to run the task on your local device
Waiting for the task to complete
Here is the sample output data, which can be exported in Excel, CSV, HTML and JSON formats.