AnsweredAssumed Answered

Using Python to scrape points from a google map embedded on a website

Question asked by ali_wertheim on Jan 15, 2020
Latest reply on Jan 15, 2020 by bharold-esristaff

Hi everyone,

 

I am trying to use the requests library + beautiful soup to pull information on the antenna points from the map shown on this website.

 

BIPT: Sitebeheer 

 

My original plan was to iterate through site numbers, pull out the lat/long information that appears on the left hand panel when a point is clicked, and display that data in Arc. So far I have accessed the <div> element where that information is located when the point is clicked (<div> id = selectedsite ... </div>). But the element turns up empty in python seemingly because nothing is clicked?

 

This is my first time web scraping and I have limited HTML knowlege, if there is another approach that would be better or any pointers you could offer that would be greatly appreciated

 

import requests
from bs4 import BeautifulSoup

#api_key = 'AIzaSyAv5Ru8AQCc9ZvfcrdYEg9SGHyDZqv55T0'

#Prettify HTML
source = requests.get("http://www.sites.bipt.be/").text
soup = BeautifulSoup(source, 'lxml')
print(soup.prettify())


# Class where information on the selected site is located - turns up empty
div = soup.find(id='selectedsite')
print(div.prettify())

Outcomes