Giter Site home page Giter Site logo

Example config? about resmed-scraper HOT 9 OPEN

handyman5 avatar handyman5 commented on September 24, 2024 1
Example config?

from resmed-scraper.

Comments (9)

handyman5 avatar handyman5 commented on September 24, 2024

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.
Screen Shot 2020-07-08 at 12 49 37 PM

from resmed-scraper.

fredrikbuchanan avatar fredrikbuchanan commented on September 24, 2024

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.

handyman5 avatar handyman5 commented on September 24, 2024

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.

fredrikbuchanan avatar fredrikbuchanan commented on September 24, 2024

Ok. Cool will test it out. Thanks

from resmed-scraper.

fredrikbuchanan avatar fredrikbuchanan commented on September 24, 2024

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.

fredrikbuchanan avatar fredrikbuchanan commented on September 24, 2024

solved the linux problem so now i have list index out of range on both win and linux

from resmed-scraper.

badreamer avatar badreamer commented on September 24, 2024

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.

joverdijk avatar joverdijk commented on September 24, 2024

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.

prestomation avatar prestomation commented on September 24, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.