Comments (9)
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.
from resmed-scraper.
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
from resmed-scraper.
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
.
from resmed-scraper.
Ok. Cool will test it out. Thanks
from resmed-scraper.
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
scores_script = [x.renderContents() for x in scripts if 'myScores' in x.renderContents()][0]
IndexError: list index out of range
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
from resmed-scraper.
solved the linux problem so now i have list index out of range on both win and linux
from resmed-scraper.
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 ...
from resmed-scraper.
Same for me. Script seems broken it won't read myScores anymore.
Traceback (most recent call last):
File "./scrape.py", line 56, in
scores_script = [x.renderContents() for x in scripts if 'myScores' in x.renderContents()][0]
IndexError: list index out of range
from resmed-scraper.
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
from resmed-scraper.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resmed-scraper.