Google Maps Scraper,用于收集各种Google Maps列表中的数据,包括商业资料。
项目描述
Google Maps Scraper
Google Maps Scraper使您能够轻松地从Google Maps和Google Places提取具有地理参考的公开数据。本简短指南将向您展示使用Oxylabs Scraper API抓取Google Maps的过程。
工作原理
您可以通过向我们服务提供URL来检索Google Maps数据。我们的API将以JSON格式返回结果。
Python代码示例
以下代码示例演示了如何获取Google Maps结果。首先,您需要使用推拉方法将指令发送到我们的服务
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'google',
'url': 'https://www.google.com/maps/search/restaurants/@40.7660158,-73.9833944,14z/data=!4m5!2m4!5m2!1e0!4e9!6e5?entry=ttu',
'geo_location': 'New York,New York,United States',
'render': 'html'
}
# Get response.
response = requests.request(
'POST',
'https://data.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload
)
# This will return a response with job status and results url.
pprint(response.json())
一旦任务完成,您可以通过发出另一个请求并包含上一个响应中的作业ID来检索结果,例如
import requests
# Get response.
response = requests.request(
'GET',
'http://data.oxylabs.io/v1/queries/{job_id}/results',
auth=('USERNAME', 'PASSWORD')
)
# This will return the JSON response with results.
print(response.json())
输出示例
上面的代码片段将检索JSON格式的结果
{
"results": [
{
"content": "<!doctype html>
<html lang="en">
<head>...</script></body>
</html>
",
"created_at": "2023-07-25 10:01:01",
"job_id": "7089545068712824833",
"page": 1,
"status_code": 200,
"updated_at": "2023-07-25 10:01:20",
"url": "https://www.google.com/maps/search/restaurants/@40.7660158,-73.9833944,14z/data=!4m5!2m4!5m2!1e0!4e9!6e5?entry=ttu"
}
]
}
从本地地标到各种商业,使用Oxylabs的Google Maps Scraper,您将轻松访问所需的公开数据。如果您有任何问题或需要帮助,请随时通过聊天或电子邮件联系我们的24/7支持团队。
项目详情
关闭
google-maps-scraper-api-0.1.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | fba7d4919b00db9ae86932d0b8438b2d1a5caf7022ee47a8eea056a729383040 |
|
MD5 | 46415650c8980a4fb2d40e2a0602ff02 |
|
BLAKE2b-256 | 594bbdf2bada78f826235fb90026235892f8377786afcb49419d635cc2302823 |
关闭
google_maps_scraper_api-0.1.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 95a5250757130c9db1942d99a20f53094f724879b4d5c60f92904703e88e024c |
|
MD5 | 1670565be28b398b23963827dba0d775 |
|
BLAKE2b-256 | a48728c48a5e3014849c8edb5ba9376b7ecd283422c4f70a155e8afa2f584594 |