All Collections
Case Tutorial
Lead Generation
Scrape store information from Bing Maps
Scrape store information from Bing Maps
Updated over a week ago

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.

1.png

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

  • Enter the target URL into the search bar on the home screen and click Start


2. Enter Text - to search for the result

  • Click on the search box

  • Click Enter Text from the Tips panel after it turns green

  • Input Restaurant in London in the Textbox

  • Click Confirm

  • Click on the search icon

  • Click Click URL on the Tips panel

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

AJAX.png

3. Set up a loop click - to extend the detailed card

  • Click on the first item card, then click on the second item card

  • Click Loop click each element on the Tips panel after both item cards turn green

  • Click Yes

  • Select Next Page button

  • Scroll down to the end of the page and click the "Next Page" icon > Click Confirm

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

LOOP.png

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

click1.png
  • 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

  • Untick Extract data in the loop > Click Apply

  • Double-click to rename data fields if needed

rename.png

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

xpath.png

5. Set up a loop for the images - to extract images on the detailed content card

  • Create Loop Item 1 under Extract data

    • Click "+" and select Loop and Loop Item 1 will be created

    • Click on Loop Item1 frame

    • Switch Loop Mode to Variable List

    • Input Xpath as: //li[@data-priority]

    • Click Apply

  • 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

    • Click More>Download files

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.

data.png
Did this answer your question?