c# parse javascript content -


so have web scraping project 1 of pages has necessary content in json format inside set of <script> tags.

here's example of said <script> tags:

<script>   window.postdata = {}   window.postdata["content"] = [json content] </script> 

i've used htmlagilitypack particular <script> tags, not sure how grab json content this. can parse json json.net or other library/framework, i'm not worried part. i'm stuck on getting json. there javascript parsing library or can use this, or there way accomplish this.

any appreciated!

check out jint

var postdatajson = new engine()     .execute("window.postdata = {}; window.postdata['content'] = [json content]")     .getvalue("window.postdata"); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -