Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrape CPAP data #52

Open
brianhanifin opened this issue Aug 26, 2020 · 2 comments
Open

Scrape CPAP data #52

brianhanifin opened this issue Aug 26, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@brianhanifin
Copy link
Owner

brianhanifin commented Aug 26, 2020

Generated with the help of Firefox Extension ScrapeMate.

Path: /Home/Sleep

{
  "AHI": {
    "sel": "#Ahi",
    "type": "css"
  },
  "MaskFit": {
    "sel": "#MaskFit",
    "type": "css"
  },
  "Usage": {
    "sel": "#Usage",
    "type": "css"
  },
  "Update": {
    "sel": "#LastUpdatedDate",
    "type": "css"
  }
}
@brianhanifin brianhanifin added the enhancement New feature or request label Aug 26, 2020
@brianhanifin
Copy link
Owner Author

brianhanifin commented Aug 27, 2020

This is the HTML login form.

<form action="/Account/LogOn?ReturnUrl=%2F" class="form-horizontal" method="post" role="form" novalidate="novalidate">
  <input name="__RequestVerificationToken" type="hidden" value="xGHU5er1ryhHPLs6vqaVRTqUMEx3O93AIQg7JsRwuiPTzyTfvSujO-fjkoUjV2pnx3lOWDEpgFjcv-Ik7VJVvQ_M33U1">

  <label id="form_heading" class="col-sm-4 control-label hide" for="Email" id="form_heading">Username</label>
  <input id="Email" name="Email" class="form-control txtlogin input-validation-error" data-action="removeEmailSpacesWeb" data-val="true" data-val-email="Invalid Email" data-val-required="'Username' is required." id="Email" name="Email" placeholder="Username" type="email" value="">

  <label id="form_heading" class="col-sm-4 control-label hide" for="Password">Password</label>
  <input id="Password" name="Password"  class="form-control txtlogin input-validation-error" data-val="true" data-val-required="'Password' is required." placeholder="Password" type="password">

  <input id="btn_submit_inverse" type="submit" value="Login" class="btn btn-default txtloginbtn" >
</form>

@brianhanifin
Copy link
Owner Author

I cannot use a web scraper to pull data from that page as the data is populated by JavaScript after the page loads. Here is the path & query string portion of the POST request.

/Home/SleepData?date=&mode=End&currentDate=&numberOfDays=14&timeZoneOffset=-7

This returns JSON data, perfect for an unofficial API. I will probably have to create a custom_component to leverage this data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant