https://github.com/nisaacson/get-view-state
Extract the view state value from an html page parsed with [cheerio](https://github.com/MatthewMueller/cheerio)
https://github.com/nisaacson/get-view-state
Last synced: 4 months ago
JSON representation
Extract the view state value from an html page parsed with [cheerio](https://github.com/MatthewMueller/cheerio)
- Host: GitHub
- URL: https://github.com/nisaacson/get-view-state
- Owner: nisaacson
- Created: 2013-04-18T18:54:47.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-18T19:08:46.000Z (about 12 years ago)
- Last Synced: 2025-03-02T21:19:00.649Z (4 months ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Get View State
Extract the view state value from an html page parsed with [cheerio](https://github.com/MatthewMueller/cheerio)
[](https://travis-ci.org/nisaacson/get-view-state)
# Installation```bash
npm install -S get-view-state
```# Usage
```js
var inspect = require('eyespect').inspector();
var cheerio = require('cheerio')
var getViewState = require('get-view-state')// file path to a webpage with a view state element in the html
var filePath = path.join(__dirname, 'data/yesViewState.html')
var html = fs.readFileSync(filePath, 'utf8')
var $ = cheerio.load(html)// extract the value attribute from the view state element
var viewState = getViewState($)
inspect(viewState, 'extracted view state')
```