resmed-scraper
resmed-scraper copied to clipboard
Example config?
Would it be possible to provide an example configuration file? Or at least instructions in the README -- I'm not 100% sure how to find viewstate
or exist_token
.
The exist_token
comes from Exist's own API; you can get one here. I changed the script logic to not attempt to log in via Python anymore. Instead, I captured a login attempt from my browser as a curl
command and have the script just run that curl
and scrape its output. I've attached a screenshot of where to do so using Chrome; if you copy that command and paste it into a file named mycurl
in the same directory as the script, it should work. Let me know if that doesn't do the trick.
Hi. I copied default aspx as cURL and created a empty config.json. but i still get errors "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)" have i missed anything? mvh Fredrik Buchanan
An empty file is not valid JSON, which is what that error is saying.
Here's an example config.json
:
{
"viewstate": "",
"email": "",
"password": "",
"exist_token": "<your Exist API token per http://developer.exist.io/#requesting-a-token>"
}
The other empty lines are used by bits of code that are no longer active and I haven't bothered to clean them up since I switched to just running curl
.
Ok. Cool will test it out. Thanks
ok i have come a bit further
but running in powershell i get:
PS C:\Drift\myair> python .\scrape.py
The command line is too long.
Traceback (most recent call last):
File "C:\Drift\myair\scrape.py", line 56, in
if i try run it on a linux first resolve host and then typeerror: a bytes-like object is requiered, not 'str'
any tips on what could be wrong
solved the linux problem so now i have list index out of range on both win and linux
Is this script still working now ? Seems like Resmed has made some changes - I am not able to see the same structure as you while I try to copy the curl command ... The 'scripts' variable is populated with the JS file names for me, and I do not see a 'myScores' text in any of those JS files ...
Same for me. Script seems broken it won't read myScores anymore.
Traceback (most recent call last):
File "./scrape.py", line 56, in
myAir has re-built their US website and it works very differently.
For anyone who is interested: I have done a similar reverse-engineering of the new page, the code can be found here: https://github.com/prestomation/resmed_myair_sensors/blob/master/custom_components/resmed_myair/myair_client.py
that package is for integration into a home automation system called 'Home Assistant', but that client file will continue to be decoupled such that it can be used outside home assistant