c# - Html agility pack parse oid -


here full html code: http://pastebin.com/wlwdcvz0

i parsed needed node agility pack. code:

var html = new htmldocument(); html.loadhtml(request.get("http://www.odnoklassniki.ru").tostring()); var h1 = html.documentnode.selectsinglenode(@"/html[1]/body[1]/div[1]/div[3]/div[2]"); 

h1 contains:

<!--{"uid":"aocrgdowcvpgtiymx0qqvblirnscijwdrcw","toolbar":true,"restrictednim":false,"restrictedmusic":false,"massuploadfix":true,"valentineactive":false,"navfactoryreqtimeout":3000,"discussionsrestricted":false,"share.urlpattern":"((?:(?:https?|ftp)://|(?:mailto:)?[-\\w!#$%\u0026'*+/\u003d?^`{|}~][-\\w!#$%\u0026'*+/\u003d?^`{|}~\\.]*@)?(?:(?:(?:(?:[\\wа-яА-Я-]+)\\.){1,5})(?:com|net|org|biz|info|name|pro|asia|aero|cat|coop|eco|jobs|mobi|museum|post|tel|travel|xxx|edu|gov|int|mil|рф|испытание|xn--[\\w-]*|[a-z]{2})|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(?::\\d{1,5})?(?:/(?:[\\w/а-яА-Я\\-\\.,/~!#$%\u0026*+;:\u003d?\\[\\]'@()]*[\\wа-яА-Я/])?)?)","friendonlinepopupduration":25000,"premic":true,"tinkoffpromolink":"http://www.odnoklassniki.ru/apps/tinkoff?tcsbanner\u003dodn_ok_bonus","valentinesamepresenticonrotatedelay":100,"configtoolbarshowspamexplanation":false,"lastname":"Иванова","menuwait":100,"configtoolbarnotificationsenableunsubscribeappeventsbutton":true,"video.player.url":"http://stg.odnoklassniki.ru/static/odklvp/0-0-83/odklvp.swf?preferhd\u003d1\u0026noupload\u003d1","menubrief":true,"menushow":500,"d_disc_ids":{"user_album":6,"movie":9,"user_photo":4,"school_forum":10,"city_news":13,"group_topic":1,"user_forum":5,"user_2lvl_forum":7,"share":8,"group_movie":12,"group_photo":2,"happening_topic":11,"chat":14,"user_status":3},"n.f.collapseenabled":false,"pcid":"aocrgdowcvpgtiymx0aosttobwcoktbnwll","maxusersinpopup":3,"notificationsrestricted":false,"toolbarnotificationshideenabled":true,"showsendoverlaylink":false,"visaonlinepromolink":"http://odnoklassniki.ru/apps/online-payments-test?view\u003dvisapromo","video.up-meta.url":"http://in.video.mail.ru/","groupoffcomments":true,"displaycloselinkwithmfvisapromo":true,"confighintenter":false,"communityspamenabled":true,"isust":false,"restricteddisc":false,"menustrict":true,"mms.groupids":["aocrgdowcvpgtiymx0rgqrvvkoexjbmjrgp","aocrgdowcvpgtiymx0rmdrfqrjqyjhmhkgts","aocrgdowcvpgtiymx0rbuixcrnynjvsiqopz"],"app.feature.openlinks.enabled":true,"oid":"567334127898","menuclose":100,"bannertargeting":{"v":{"d":"25","r":"307","n":"Анжела","m":"1","i":"567334127898"},"u":"aaaahbe/yroaaae9nxb67xpb+4ykhvkyvca+tuqr8z8\u003d","t":"obld1aaaaaaiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaqaaaaaabkbxqcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac\u003d"},"firstname":"Анжела","configtoolabrremoveconversation":true,"mpid":{"photoid":"491764025626"},"layoutconfig":"313542320128","friendonlinepopupposition":"right","denbl":true,"lbaidl":true,"male":false,"app.feature.openlinks.statuses.enabled":true,"overlaycategory":"1","restricted":false,"plaintooltips":true,"confighintsound":false,"ddelay":300000,"ditclosedsz":0,"ditsz":3,"ddelaypd":600000,"haswishlist":false,"overlaylinkgendermask":2,"configtoolbarsmilesversion2":true}--> 

what need next if must oid value (567334127898) var?

i assuming oid can contain numbers ? correct me if wrong.

var match = regex.match(h1,"\"oid\":\"(?<oid>\\d+)\"");  string oid = match.groups["oid"].value; console.writeline(oid); 

where h1 contents of node (as string) parsing html agility pack


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -