Парсинг Instagramm на C#

257
07 апреля 2018, 18:31

День добрый,товарищи. На днях решил написать первый парсер. Но что-то пошло не так. Использую HtmlAgilityPack и xNet. Вот код для получения страницы:

HttpRequest rq = new HttpRequest();
string inst = "https://www.instagram.com/";
rq.Cookies = new CookieDictionary();
string response = rq.Get(inst + pagename).ToString();

Но, вместо страницы инстаграмма я получаю такую вот штуку:

<!DOCTYPE html>\n<html lang=\"en\" class=\"no-js not-logged-in client-root\">\n    <head><meta charset=\"utf-8\">\n        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n\n        <title>\nInstagram\n</title>\n\n        \n        <meta name=\"robots\" content=\"noimageindex, noarchive\">\n        <meta name=\"mobile-web-app-capable\" content=\"yes\">\n        <meta name=\"theme-color\" content=\"#000000\">\n        <meta id=\"viewport\" name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover\">\n        \n\n        <link rel=\"manifest\" href=\"/data/manifest.json\">\n\n        \n          <link href=\"https://graph.instagram.com\" rel=\"preconnect\" crossorigin>\n        \n\n        \n        <link rel=\"preload\" href=\"/static/bundles/base/LandingPage.js/341b06816b56.js\" as=\"script\" type=\"text/javascript\" crossorigin=\"anonymous\" />\n\n        <script type=\"text/javascript\">\n        (function() {\n            var docElement = document.documentElement;\n            var classRE = new RegExp('(^|\\\\s)no-js(\\\\s|$)');\n            var className = docElement.className;\n            docElement.className = className.replace(classRE, '$1js$2');\n        })();\n        </script>\n        <script type=\"text/javascript\">\n        (function() {\n          if ('PerformanceObserver' in window && 'PerformancePaintTiming' in window) {\n            window.__bufferedPerformance = [];\n            var ob = new PerformanceObserver(function(e) {\n              window.__bufferedPerformance.push.apply(window.__bufferedPerformance,e.getEntries());\n            });\n            ob.observe({entryTypes:['paint']});\n          }\n        })();\n        </script>\n    \n                <link rel=\"apple-touch-icon-precomposed\" sizes=\"76x76\" href=\"/static/images/ico/apple-touch-icon-76x76-precomposed.png/932e4d9af891.png\">\n                <link rel=\"apple-touch-icon-precomposed\" sizes=\"120x120\" href=\"/static/images/ico/apple-touch-icon-120x120-precomposed.png/004705c9353f.png\">\n                <link rel=\"apple-touch-icon-precomposed\" sizes=\"152x152\" href=\"/static/images/ico/apple-touch-icon-152x152-precomposed.png/82467bc9bcce.png\">\n                <link rel=\"apple-touch-icon-precomposed\" sizes=\"167x167\" href=\"/static/images/ico/apple-touch-icon-167x167-precomposed.png/515cb4eeeeee.png\">\n                <link rel=\"apple-touch-icon-precomposed\" sizes=\"180x180\" href=\"/static/images/ico/apple-touch-icon-180x180-precomposed.png/94fd767f257b.png\">\n                \n                    <link rel=\"icon\" sizes=\"192x192\" href=\"/static/images/ico/favicon-192.png/b407fa101800.png\">\n                \n            \n            \n                    <link rel=\"mask-icon\" href=\"/static/images/ico/favicon.svg/9d8680ab8a3c.svg\" color=\"#262626\">\n                  \n                  <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/static/images/ico/favicon.ico/dfa85bb1fd63.ico\">\n                \n            \n            \n            \n    \n    \n<meta property=\"al:ios:app_name\" content=\"Instagram\" />\n<meta property=\"al:ios:app_store_id\" content=\"389801252\" />\n<meta property=\"al:ios:url\" content=\"instagram://mainfeed\" />\n<meta property=\"al:android:app_name\" content=\"Instagram\" />\n<meta property=\"al:android:package\" content=\"com.instagram.android\" />\n<meta property=\"al:android:url\" content=\"https://www.instagram.com/_n/mainfeed/\" />\n\n<meta property=\"og:site_name\" content=\"Instagram\" />\n<meta property=\"og:title\" content=\"Instagram\" />\n<meta property=\"og:image\" content=\"/static/images/ico/favicon-200.png/a0d593d4e9d5.png\" />\n<meta property=\"fb:app_id\" content=\"124024574287414\" />\n<meta property=\"og:url\" content=\"https://instagram.com/\" />\n<meta content=\"Create an account or log in to Instagram - A simple, fun &amp; creative way to capture, edit &amp; share photos, videos &amp; messages with friends &amp; family.\" name=\"description\" />\n\n\n    <link rel=\"alternate\" href=\"https://www.instagram.com/\" hreflang=\"x-default\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=en\" hreflang=\"en\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=fr\" hreflang=\"fr\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=it\" hreflang=\"it\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=de\" hreflang=\"de\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es\" hreflang=\"es\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=zh-cn\" hreflang=\"zh-cn\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=zh-tw\" hreflang=\"zh-tw\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ja\" hreflang=\"ja\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ko\" hreflang=\"ko\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=pt\" hreflang=\"pt\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=pt-br\" hreflang=\"pt-br\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=af\" hreflang=\"af\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=cs\" hreflang=\"cs\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=da\" hreflang=\"da\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=el\" hreflang=\"el\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=fi\" hreflang=\"fi\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=hr\" hreflang=\"hr\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=hu\" hreflang=\"hu\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=id\" hreflang=\"id\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ms\" hreflang=\"ms\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=nb\" hreflang=\"nb\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=nl\" hreflang=\"nl\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=pl\" hreflang=\"pl\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ru\" hreflang=\"ru\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=sk\" hreflang=\"sk\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=sv\" hreflang=\"sv\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=th\" hreflang=\"th\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=tl\" hreflang=\"tl\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=tr\" hreflang=\"tr\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=hi\" hreflang=\"hi\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=bn\" hreflang=\"bn\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=gu\" hreflang=\"gu\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=kn\" hreflang=\"kn\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ml\" hreflang=\"ml\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=mr\" hreflang=\"mr\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=pa\" hreflang=\"pa\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ta\" hreflang=\"ta\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=te\" hreflang=\"te\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ne\" hreflang=\"ne\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=si\" hreflang=\"si\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ur\" hreflang=\"ur\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=vi\" hreflang=\"vi\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=bg\" hreflang=\"bg\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=fr-ca\" hreflang=\"fr-ca\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=ro\" hreflang=\"ro\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=sr\" hreflang=\"sr\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=uk\" hreflang=\"uk\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=zh-hk\" hreflang=\"zh-hk\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-gt\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-cl\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-co\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-py\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-ve\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-ni\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-pe\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-bo\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-ec\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-do\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-pa\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-pr\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-uy\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-ar\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-hn\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-sv\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-mx\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-cr\" />\n<link rel=\"alternate\" href=\"https://www.instagram.com/?hl=es-la\" hreflang=\"es-cu\" />\n    \n</head>\n    <body class=\"\">\n        \n    <span id=\"react-root\"></span>\n\n        \n\n        \n            <script type=\"text/javascript\">window._sharedData = {\"activity_counts\":null,\"config\":{\"csrf_token\":\"CLd4TuuUXYVjoeJ5fCt9MUOOxnjF79Yu\",\"viewer\":null},\"supports_es6\":false,\"country_code\":\"RU\",\"language_code\":\"en\",\"locale\":\"en_US\",\"entry_data\":{\"LandingPage\":[{\"captcha\":{\"enabled\":false,\"key\":\"\"},\"hsite_redirect_url\":\"\",\"prefill_phone_number\":\"\",\"gdpr_required\":false}]},\"gatekeepers\":{\"ld\":true,\"seo\":true,\"seoht\":true},\"knobs\":{\"acct:ntb\":0},\"qe\":{\"dash_for_vod\":{\"g\":\"\",\"p\":{}},\"aysf\":{\"g\":\"\",\"p\":{}},\"bc3l\":{\"g\":\"\",\"p\":{}},\"comment_reporting\":{\"g\":\"\",\"p\":{}},\"direct_reporting\":{\"g\":\"\",\"p\":{}},\"reporting\":{\"g\":\"\",\"p\":{}},\"media_reporting\":{\"g\":\"\",\"p\":{}},\"acc_recovery_link\":{\"g\":\"\",\"p\":{}},\"notif\":{\"g\":\"\",\"p\":{}},\"drct_nav\":{\"g\":\"\",\"p\":{}},\"pl_pivot_li\":{\"g\":\"\",\"p\":{}},\"pl_pivot_lo\":{\"g\":\"\",\"p\":{}},\"404_as_react\":{\"g\":\"\",\"p\":{}},\"acc_recovery\":{\"g\":\"\",\"p\":{}},\"client_gql\":{\"g\":\"\",\"p\":{}},\"collections\":{\"g\":\"\",\"p\":{}},\"comment_ta\":{\"g\":\"\",\"p\":{}},\"connections\":{\"g\":\"\",\"p\":{}},\"disc_ppl\":{\"g\":\"\",\"p\":{}},\"embeds\":{\"g\":\"\",\"p\":{}},\"ebdsim_li\":{\"g\":\"\",\"p\":{}},\"ebdsim_lo\":{\"g\":\"\",\"p\":{}},\"es6\":{\"g\":\"\",\"p\":{}},\"exit_story_creation\":{\"g\":\"\",\"p\":{}},\"fs\":{\"g\":\"\",\"p\":{}},\"gdpr_logged_out\":{\"g\":\"\",\"p\":{}},\"appsell\":{\"g\":\"\",\"p\":{}},\"imgopt\":{\"g\":\"\",\"p\":{}},\"follow_button\":{\"g\":\"\",\"p\":{}},\"loggedout\":{\"g\":\"launch\",\"p\":{\"new_cta\":\"true\",\"remove_upsell_banner\":\"true\",\"update_nav\":\"true\"}},\"loggedout_upsell\":{\"g\":\"test_with_new_loggedout_upsell_content_03_15_18\",\"p\":{\"has_new_loggedout_upsell_content\":\"true\"}},\"us_li\":{\"g\":\"\",\"p\":{}},\"msisdn\":{\"g\":\"\",\"p\":{}},\"bg_sync\":{\"g\":\"\",\"p\":{}},\"onetaplogin\":{\"g\":\"\",\"p\":{}},\"onetaplogin_userbased\":{\"g\":\"\",\"p\":{}},\"login_poe\":{\"g\":\"\",\"p\":{}},\"prvcy_tggl\":{\"g\":\"\",\"p\":{}},\"private_lo\":{\"g\":\"\",\"p\":{}},\"profile_photo_nux_fbc_v2\":{\"g\":\"\",\"p\":{}},\"push_notifications\":{\"g\":\"\",\"p\":{}},\"reg\":{\"g\":\"new_reg_with_appsells_01_10\",\"p\":{\"has_new_landing_appsells\":\"true\",\"has_new_landing_page\":\"true\"}},\"reg_vp\":{\"g\":\"test_group_1\",\"p\":{\"hide_value_prop\":\"true\"}},\"feed_vp\":{\"g\":\"\",\"p\":{}},\"report_haf\":{\"g\":\"\",\"p\":{}},\"report_media\":{\"g\":\"\",\"p\":{}},\"report_profile\":{\"g\":\"\",\"p\":{}},\"save\":{\"g\":\"\",\"p\":{}},\"sidecar\":{\"g\":\"\",\"p\":{}},\"su_universe\":{\"g\":\"control_login_autocomplete\",\"p\":{\"use_autocomplete_login\":\"false\"}},\"stale\":{\"g\":\"\",\"p\":{}},\"stories_lo\":{\"g\":\"\",\"p\":{}},\"stories\":{\"g\":\"\",\"p\":{}},\"tp_pblshr\":{\"g\":\"\",\"p\":{}},\"video\":{\"g\":\"\",\"p\":{}},\"gdpr_settings\":{\"g\":\"\",\"p\":{}}},\"hostname\":\"www.instagram.com\",\"display_properties_server_guess\":{\"pixel_ratio\":1.5,\"viewport_width\":360,\"viewport_height\":480,\"orientation\":\"\"},\"environment_switcher_visible_server_guess\":true,\"platform\":\"web\",\"rhx_gis\":\"3defae15d78743caff568d5d5122be91\",\"nonce\":\"HyCMDt2aQko/4y9JZq7PPg==\",\"is_bot\":false,\"zero_data\":{},\"rollout_hash\":\"930d98104ef2\",\"bundle_variant\":\"base\",\"probably_has_app\":false,\"show_app_install\":true};</script>\n            <script type=\"text/javascript\" src=\"/static/bundles/base/Polyfills.js/9b36f184e49e.js\" crossorigin=\"anonymous\"></script>\n            <script type=\"text/javascript\" src=\"/static/bundles/base/Vendor.js/0b34a2e2f7c2.js\" crossorigin=\"anonymous\"></script>\n<script type=\"text/javascript\">!function(e){var a=window.webpackJsonp;window.webpackJsonp=function(n,r,i){for(var c,d,s,f=0,g=[];f<n.length;f++)d=n[f],o[d]&&g.push(o[d][0]),o[d]=0;for(c in r)Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c]);for(a&&a(n,r,i);g.length;)g.shift()();if(i)for(f=0;f<i.length;f++)s=t(t.s=i[f]);return s};var n={},o={59:0};function t(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.e=function(e){var a=o[e];if(0===a)return new Promise(function(e){e()});if(a)return a[2];var n=new Promise(function(n,t){a=o[e]=[n,t]});a[2]=n;var r=document.getElementsByTagName(\"head\")[0],i=document.createElement(\"script\");i.type=\"text/javascript\",i.charset=\"utf-8\",i.async=!0,i.timeout=12e4,i.crossOrigin=\"anonymous\",t.nc&&i.setAttribute(\"nonce\",t.nc),i.src=t.p+\"\"+({0:\"SettingsModules\",1:\"ProfilePageContainer\",2:\"LikedByListContainer\",3:\"FollowListContainer\",4:\"CreationModules\",5:\"LocationPageContainer\",6:\"DiscoverMediaPageContainer\",7:\"TagPageContainer\",8:\"DiscoverEmbedsPageContainer\",9:\"UserCollectionMediaPageContainer\",10:\"DebugInfoNub\",11:\"FeedPageContainer\",12:\"PostPageContainer\",13:\"LandingPage\",14:\"LoginAndSignupPage\",15:\"ResetPasswordPageContainer\",16:\"MobileStoriesPage\",17:\"DesktopStoriesPage\",18:\"IGTVVideoUploadPage\",19:\"DiscoverPeoplePageContainer\",20:\"UserCollectionsPageContainer\",21:\"DataDownloadRequestPage\",22:\"ContactHistoryPage\",23:\"MultiStepSignupPage\",24:\"DataDownloadRequestConfirmPage\",25:\"DataControlsSupportPage\",26:\"AccessToolPage\",27:\"EmailConfirmationPage\",28:\"LocationsDirectoryLandingPage\",29:\"LocationsDirectoryCountryPage\",30:\"LocationsDirectoryCityPage\",31:\"SuggestedDirectoryLandingPage\",32:\"ProfilesDirectoryLandingPage\",33:\"HashtagsDirectoryLandingPage\",34:\"OAuthPermissionsPage\",35:\"DirectoryPage\",36:\"HttpErrorPage\",37:\"ActivityFeedPage\",38:\"DirectInboxPageContainer\",39:\"FBSignupPage\",40:\"StoryCreationPage\",41:\"NewUserInterstitial\",42:\"ParentalConsentPage\",43:\"CheckpointUnderageAppealPage\",44:\"ContactInvitesOptOutPage\",45:\"ContactInvitesOptOutStatusPage\",46:\"Report\",47:\"Copyright\",48:\"SupportInfo\",49:\"Community\",50:\"GenericSurvey\",51:\"Challenge\",52:\"Consumer\",53:\"EmailSnoozePage\",54:\"EmailUnsubscribePage\",55:\"ConfirmFollowDialog\",56:\"NotificationLandingPage\"}[e]||e)+\".js/\"+{0:\"395fe30c4262\",1:\"3dc5fe76c86e\",2:\"494c38a009c3\",3:\"5c319a3baf67\",4:\"97e6951f8c20\",5:\"c5e554983a5c\",6:\"f1e9b847e508\",7:\"9d679a785562\",8:\"c3e30b5b5d4c\",9:\"c091a7fba31f\",10:\"f4fc91af1541\",11:\"77ad9c2f49eb\",12:\"640bf5734669\",13:\"341b06816b56\",14:\"d1a6cd68012e\",15:\"0cb8ee9be043\",16:\"005c10c0ceea\",17:\"6e8c1870db1d\",18:\"31c27722b641\",19:\"090119f97ccd\",20:\"16b973acd1a1\",21:\"ff1785407a2d\",22:\"612bfeef3a0e\",23:\"5a3c415ca20a\",24:\"a33962707b47\",25:\"c68f1f083439\",26:\"98aeea8d7265\",27:\"391817ebb7fc\",28:\"1496d9a3dfe6\",29:\"4ed4dcaa41ab\",30:\"422982a0a0ef\",31:\"2eafed182bd5\",32:\"fa952369a775\",33:\"08ee3fff4176\",34:\"d5f299a44590\",35:\"3513d492fbf7\",36:\"ab6d6cd8ccb3\",37:\"6f56be28dc11\",38:\"be22aa9c8794\",39:\"c229e08d65a7\",40:\"044101705216\",41:\"4de02f96dd3d\",42:\"4d3cca7b69d4\",43:\"d155af502216\",44:\"57fdef6dcf72\",45:\"2879d7b0ea9e\",46:\"e1b6b07c8eee\",47:\"e5ecc9dad41c\",48:\"758cd1ca36f3\",49:\"271e15ec4993\",50:\"ea58e2c2c6fb\",51:\"9458e3087918\",52:\"3c54c0a47119\",53:\"2b4487471a9f\",54:\"264dde10483d\",55:\"e429be1ac07b\",56:\"64e17732acf8\"}[e]+\".js\";var c=setTimeout(d,12e4);function d(){i.onerror=i.onload=null,clearTimeout(c);var a=o[e];0!==a&&(a&&a[1](new Error(\"Loading chunk \"+e+\" failed.\")),o[e]=void 0)}return i.onerror=i.onload=d,r.appendChild(i),n},t.m=e,t.c=n,t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,\"a\",a),a},t.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},t.p=\"/static/bundles/base/\",t.oe=function(e){throw console.error(e),e}}([]);</script>\n            <script type=\"text/javascript\" src=\"/static/bundles/base/LandingPage.js/341b06816b56.js\" crossorigin=\"anonymous\" charset=\"utf-8\" async=\"\"></script>\n<script type=\"text/javascript\" src=\"/static/bundles/base/en_US.js/f6429c133ec1.js\" crossorigin=\"anonymous\"></script>\n<script type=\"text/javascript\" src=\"/static/bundles/base/ConsumerCommons.js/0f33bd7f778c.js\" crossorigin=\"anonymous\"></script>\n<script type=\"text/javascript\" src=\"/static/bundles/base/Consumer.js/3c54c0a47119.js\" crossorigin=\"anonymous\"></script>\n<script>\n!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?\nn.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;\nn.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;\nt.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,\ndocument,'script','//connect.facebook.net/en_US/fbevents.js');\n\nfbq('init', '1425767024389221');\n\nfbq('track', 'PageView');\n\n\n</script>\n<noscript>\n\n\n</noscript>\n\n        \n    </body>\n</html>"

Я полагаю, там выполняется какой-то скрипт, а потом, вторым заходом загружается страница, но что с этим делать я не догоняю. Буду признателен за совет

Answer 1

Используйте движки к примеру Chromium или WebDriver, пример применения.

 using OpenQA.Selenium.PhantomJS;
        public static string GetPageSource(string url)
        {
            var driverService = PhantomJSDriverService.CreateDefaultService();
            driverService.HideCommandPromptWindow = true;
            var Driver = new PhantomJSDriver(driverService);
            Driver.Url = url;
            Driver.Navigate();
            string html = Driver.PageSource;
            Driver.Close();
            Driver.Quit();
            return html;
        }
READ ALSO
Символ &ldquo;рубль&rdquo; для всех устройств

Символ “рубль” для всех устройств

Использую такой знак ₽ на сайте, но на старых мобильных устройствах он отображается так □Подскажите, пожалуйста, как лучше всего его оптимизировать...

296
несколько таблиц exceljs

несколько таблиц exceljs

доброго времени суток, могу поинтересоваться кто пользовался библиотекой exceljs ??? нужен экспорт нескольких таблиц в эксельный документ формата...

214
Структура данных HashMap

Структура данных HashMap

Подскажите, полез к HashMap под капот после прочтения пару статейИ не могу понять, HashMap был изменён или я смотрю не туда

223
Проблема кодировки в android и json

Проблема кодировки в android и json

Мне нужно из приложения андроид передать строку с кириллицей в список который находится в sharepoint от microsoft,использую для этого JSONObject(orgjson),все...

260