diff --git a/tool/bluetooth_gatt.py b/tool/bluetooth_gatt.py index 556fb585c..d0b8aefca 100755 --- a/tool/bluetooth_gatt.py +++ b/tool/bluetooth_gatt.py @@ -10,6 +10,8 @@ import requests import sys import os +headers = {'user-agent': 'curl/7.63.0'} + program_info = ''' BTstack GATT UUID Scraper for BTstack Copyright 2016, BlueKitchen GmbH @@ -35,17 +37,23 @@ trailer = ''' #endif ''' +def strip_non_ascii(string): + stripped = (c for c in string if 0 < ord(c) < 127) + return ''.join(stripped) + def scrape_page(fout, url): print("Parsing %s" % url) fout.write(page_info.format(page=url)) - page = requests.get(url) + page = requests.get(url, headers=headers) tree = html.fromstring(page.content) - # get all