aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2022-06-19 02:22:14 +0200
committerTeddy Wing2022-06-25 13:46:38 +0200
commitb90e6dc5b4b0652340e0662f5d841d148211fcfc (patch)
tree626a97f0b8d5ef6da5afe6a3c87012f7837a54d4
parent944bd268d68924f8e94ce0836f4381a5cdf3e9db (diff)
downloadcws-status-b90e6dc5b4b0652340e0662f5d841d148211fcfc.tar.bz2
Extract extension names and publish statuses from the page
-rw-r--r--cws-status9
1 files changed, 8 insertions, 1 deletions
diff --git a/cws-status b/cws-status
index e2c4ba0..3f6e2ba 100644
--- a/cws-status
+++ b/cws-status
@@ -3,6 +3,7 @@
from urllib import request
import browser_cookie3
+from lxml import html
url = 'https://chrome.google.com/webstore/devconsole/<UUID>'
@@ -14,4 +15,10 @@ opener = request.build_opener(request.HTTPCookieProcessor(cookie_jar))
page_html = opener.open(url).read()
-print(page_html)
+tree = html.fromstring(page_html)
+
+item_names = tree.xpath('//table[//th[text()="Item"]]/tbody/tr/td[1]/a/div//text()')
+print(item_names)
+
+item_statuses = tree.xpath('//table[//th[text()="Item"]]/tbody/tr/td[7]/text()')
+print(item_statuses)