tools: update Bluetooth SIG scrapers

This commit is contained in:
Matthias Ringwald 2017-01-21 17:58:17 +01:00
parent 2c68f1640c
commit 86f9f81a43
3 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ def scrape_page(fout, url):
print('-' * 70)
# get all <tr> elements in <table id="gattTable">
rows = tree.xpath('//div[@class="table-time"]/table/tbody/tr')
rows = tree.xpath('//div[@class="copy-block ta-left"]/table/tbody/tr')
for row in rows:
children = row.getchildren()
data_type_value = children[0].text_content()

View File

@ -40,7 +40,7 @@ def scrape_page(fout, url):
page = requests.get(url)
tree = html.fromstring(page.content)
# get all <tr> elements in <table id="gattTable">
rows = tree.xpath('//table[@id="gattTable"]/tr')
rows = tree.xpath('//table[@id="gattTable"]/tbody/tr')
for row in rows:
children = row.getchildren()
summary = children[0].text_content()

View File

@ -38,7 +38,7 @@ def list_services():
page = requests.get(url)
tree = html.fromstring(page.content)
# get all <tr> elements in <table id="gattTable">
rows = tree.xpath('//table[@id="gattTable"]/tr')
rows = tree.xpath('//table[@id="gattTable"]/tbody/tr')
print("%-55s| %-30s| %s" % ('Specification Type', 'Specification Name', 'UUID'))
print('-'*55 + '+-' + '-' * 30 + '+-' + '-'*10)
maxlen_type = 0