C# - ScrapySharp - how to get the from the <head>?</a></h1> </div> <div class="grid fw-wrap pb8 mb16 bb bc-black-075"> <div class="grid--cell ws-nowrap mr16 mb8" title="2016-01-12 19:07:53Z"> <span class="fc-light mr2">Asked</span> <time itemprop="dateCreated" datetime="2020-07-30T19:10:19.490" class="fromnow">Jul 30 '20 at 19:10</time> </div> <div class="grid--cell ws-nowrap mr16 mb8"> <span class="fc-light mr2">Active</span> <time class="fromnow" title="2020-07-31T05:49:49.330" datetime="2020-07-31T05:49:49.330">Jul 31 '20 at 05:49</a> </div> <div class="grid--cell ws-nowrap mb8" title="Viewed 92 times"> <span class="fc-light mr2">Viewed</span> 92 times </div> </div> <div id="mainbar" role="main" aria-label="questions and answers"> <div id="question" class="question" data-questionid="63179793" data-ownerid="13968197" data-score="0"> <div class="post-layout"> <div class="votecell post-layout--left"> <div class="js-voting-container grid jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="63179793"> <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"></path></svg></button> <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="0">0</div> <button class="js-bookmark-btn s-btn s-btn__unset c-pointer py4"> <svg aria-hidden="true" class="svg-icon iconBookmark" width="18" height="18" viewBox="0 0 18 18"><path d="M6 1a2 2 0 00-2 2v14l5-4 5 4V3a2 2 0 00-2-2H6zm3.9 3.83h2.9l-2.35 1.7.9 2.77L9 7.59l-2.35 1.7.9-2.76-2.35-1.7h2.9L9 2.06l.9 2.77z"></path></svg> <div class="js-bookmark-count mt4" data-value=""></div> </button> </div> </div> <div class="postcell post-layout--right"> <div class="s-prose js-post-body" itemprop="text"><p>I want to get the title from a webpage through ScrapySharp. With CssSelect, I'm only getting the <code><body></code> tag.</p> <p>I am using it like:</p> <pre><code>string SearchQuery = PageResult.Html.CssSelect(".breadcrump-summary").First().InnerText; </code></pre></div> <div class="mt24 mb12"> <div class="post-taglist grid gs4 gsy fd-column"> <div class="grid ps-relative"> <a href="../../questions/tagged/c#" class="post-tag js-gps-track" title="show questions tagged 'c#'" rel="tag">c#</a> <a href="../../questions/tagged/web-scraping" class="post-tag js-gps-track" title="show questions tagged 'web-scraping'" rel="tag">web-scraping</a> <a href="../../questions/tagged/scrapysharp" class="post-tag js-gps-track" title="show questions tagged 'scrapysharp'" rel="tag">scrapysharp</a> </div> </div> </div> <div class="mb0"> <div class="mt16 grid gs8 gsy fw-wrap jc-end ai-start pt4 mb16"> <div class="grid--cell mr16 fl1 w96"></div> <div class="post-signature grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="edited Jul 31 '20 at 05:49">edited Jul 31 '20 at 05:49</time> <a href="../../users/1438368/user94614" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1438368.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user94614" /> </a> <div class="s-user-card--info"> <a href="../../users/1438368/user94614" class="s-user-card--link">user94614</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">511</li> <li class="s-award-bling s-award-bling__gold" title="3 gold badges">3</li> <li class="s-award-bling s-award-bling__silver" title="6 silver badges">6</li> <li class="s-award-bling s-award-bling__bronze" title="26 bronze badges">26</li> </ul> </div> </div> </div> <div class="post-signature owner grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jul 30 '20 at 19:10">asked Jul 30 '20 at 19:10</time> <a href="../../users/13968197/jonathan-kopka" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/13968197.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Jonathan Kopka" /> </a> <div class="s-user-card--info"> <a href="../../users/13968197/jonathan-kopka" class="s-user-card--link">Jonathan Kopka</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1</li> <li class="s-award-bling s-award-bling__bronze" title="2 bronze badges">2</li> </ul> </div> </div> </div> </div> </div> </div> <div class="post-layout--right js-post-comments-component"> <div id="comments-63179793" class="comments js-comments-container bt bc-black-075 mt12 " data-post-id="63179793" data-min-length="15"> <ul class="comments-list js-comments-list" data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true"> <li id="comment-111724645" class="comment js-comment " data-comment-id="111724645" data-comment-owner-id="1438368" data-comment-score="0"> <div class="js-comment-actions comment-actions"> <div class="comment-score js-comment-edit-hide"> </div> </div> <div class="comment-text js-comment-text-and-form"> <a name="comment111724645_63179793"></a> <div class="comment-body js-comment-edit-hide"> <span class="comment-copy">Maybe you could try returning the entire website and breaking it down from there? Shouldn't take too long to iterate until you reach the ``?</span> – <a href="../../users/1438368/user94614" title="511 reputation" class="comment-user ">user94614</a> <span class="comment-date" dir="ltr"><a class="comment-link" href="../../questions/63179793/c-scrapysharp-how-to-get-the-title-from-the-head#comment111724645_63179793"><span title="2020-07-30T20:34:54.100 License: CC BY-SA 4.0" class="relativetime-clean">Jul 30 '20 at 20:34</span></a></span> </div> </div> </li> <li id="comment-111733164" class="comment js-comment " data-comment-id="111733164" data-comment-owner-id="13968197" data-comment-score="0"> <div class="js-comment-actions comment-actions"> <div class="comment-score js-comment-edit-hide"> </div> </div> <div class="comment-text js-comment-text-and-form"> <a name="comment111733164_63179793"></a> <div class="comment-body js-comment-edit-hide"> <span class="comment-copy">that's a possibility. But there must be a method to get directly to the head-tag. the other ones are no problem.</span> – <a href="../../users/13968197/jonathan-kopka" title="1 reputation" class="comment-user owner">Jonathan Kopka</a> <span class="comment-date" dir="ltr"><a class="comment-link" href="../../questions/63179793/c-scrapysharp-how-to-get-the-title-from-the-head#comment111733164_63179793"><span title="2020-07-31T05:51:33.100 License: CC BY-SA 4.0" class="relativetime-clean">Jul 31 '20 at 05:51</span></a></span> </div> </div> </li> <li id="comment-111741740" class="comment js-comment " data-comment-id="111741740" data-comment-owner-id="1438368" data-comment-score="0"> <div class="js-comment-actions comment-actions"> <div class="comment-score js-comment-edit-hide"> </div> </div> <div class="comment-text js-comment-text-and-form"> <a name="comment111741740_63179793"></a> <div class="comment-body js-comment-edit-hide"> <span class="comment-copy">I agree with you but I don't have the website nor have I used ScrappySharp. I'd like to think it is similar to HMTL Agility Pack</span> – <a href="../../users/1438368/user94614" title="511 reputation" class="comment-user ">user94614</a> <span class="comment-date" dir="ltr"><a class="comment-link" href="../../questions/63179793/c-scrapysharp-how-to-get-the-title-from-the-head#comment111741740_63179793"><span title="2020-07-31T11:46:16.107 License: CC BY-SA 4.0" class="relativetime-clean">Jul 31 '20 at 11:46</span></a></span> </div> </div> </li> </ul> </div> </div> </div> </div> <div id="answers"> <a name="tab-top"></a> <div id="answers-header"> <div class="answers-subheader grid ai-center mb8"> <div class="grid--cell fl1"> <h2 class="mb0" data-answercount="9">0 Answers<span style="display:none;" itemprop="answerCount">0</span></h2> </div> </div> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>