Reading div content of an external web page in c# ASP .Net - html

I have a plan of developing a web site, in that i have to read the content of an external web page. Is there any way to achieve the same in c# asp.net since i am little familiar with this language.
<html>
<head>
<title>
some title goes here
</title>
</head>
<body>
<div id="Container">
<div id="Main_Contents">
<div class="news">Some contents here.</div>
<div class="news">Some contents here. Some more here.</div>
<div class="news">Some contents here. Few more contents are here</div>
<div class="UnWanted">Unnecessary contents presents here</div>
<div class="news">Some contents here.</div>
</div>
</div>
</body>
</html>
Assume that, above like page is an external page. Now my intention is to read the content of the div whose class is 'news' i.e., <div class="news">
not that div with 'UnWanted' class. There might be more number of div's like this in a page and i have to get all of them in an order.
I have done the same in PHP using html_dom library, but now i am switching over to ASP .Net

Related

Using custom tags to incase proper tags in HTML

After reading What are the implications of using custom tags in HTML? I have decided to not use custom tags the way I was planning to use them so that I follow standards, and bots may read my code properly. Although, I wanted to know if rather than using custom tags for divs, if incasing these divs within custom tags would still cause any negative effect to my source.
I wouldn't be using: <SomeDiv> rather than <div class="SomeDiv">
Something more along the lines of:
<header>
<nav>
<div class="navWrap">
<div class="navGutz">
NAVBAR
</div>
</div>
</nav>
<logo>
<div class="logo">
LOGO
</div>
</logo>
</header>
<content>
<left>
<div class="myContent">
<topContent>
Main content and more divs
</topContent>
</div>
</left>
<right>
<div class="sidebar">
<news>
News
</news>
</div>
</right>
</content>
<footer>
<div class="social">
Social Links
</div>
<div class="copyright">
Copyright
</div>
</footer>
I ask because rather than using comments to label sections, I wanted to use tags. That way if for any reason I wanted to add style to the section in a whole, I would be able. Visually looking at it it seems a little redundant, but there would be more to it rather than what is just in the example.
So to restate the question, would incasing my content (that is up to standards) with custom tags cause any sort of negative effects against my site? Whether it be indexing, crawling, score, etc.
You should check this article on DEV. The article is about Custom HTML tags, Web Components, the Custom Elements spec and the few js libs.

Need a basic template for a dashboard with header, footer and left panel

Its been a while since I am trying to build a basic template having header, footer, left panel and main section using bootstrap, but I found bootstrap documentation is pretty vague and hard to figure out the actual html template for my requiremnt, especially for newbie like me. Can someone has any basic template using bootstrap like the image below.
Using this boostrap grid generator: http://shoelace.io/. I've added classes to the divs so you know which one is which.
<div class="container">
<div class="row header">
<div class="header col-sm-10"></div>
</div>
<div class="row content">
<div class="nav col-sm-3"></div>
<div class="main col-sm-7"></div>
</div>
<div class="row footer">
<div class="footer col-sm-10"></div>
</div>
</div>
As #Mech suggested the link http://shoelace.io/ has an interface where we can customize our basic layout of an html page. First design the the header/footer/Main section in this util page (All you need to do is simply select the column and drag it as per the size of the section you are designing for). Dynamically the html content will be generated as you design it.

Page loads within a page, rather can completely reloading

I wrote some custom HTML code in my Wikidot article - instead of the "original" Wikidot syntax, I have to use <a href="/page"> for links.
The content of my custom HTML block is like this:
<section class="intro">
<div class="container">
<h1>Headline-line text</h1>
</div>
</section>
<section class="timeline">
<ul>
<li>
<div>
<time>Time value </time> Text. Link here.
</div>
</li>
</ul>
</section>
The problem is that it loads the entire content of the HTML into that carefully selected small portion of the original site.
I can only assume that it has something to do with <div>s, as I've already seen this issue on other sites. Hence my assumption is that there must be a general source of this issue, and this is why I'm asking.
What's the reason of this problem and how can I avoid it?

Extract information from HTML when it is retrieved using JSON

I got this part of code:
<div id="main">
<div class="wrapper clearfix" id="content">
<section class="clearfix">
<article id="market_data" ng-app="eex.market_data" data-src="/blueprint/" data-config="/json/en/20776/content.json?config=" class="ng-cloak">
<div id="content">
<div market-data-page-title></div>
<div market-data-datepicker></div>
<div ng-view></div>
</div>
</article>
</section>
</div>
Where some data is retrieved using json, which makes the final HTML invisible to me, talking about code. I need to get some data that is drawed on the HTML using VB.NET, so I download the whole file and search for what I need but it isn't there.
Is there a way to catch this information?? I thought maybe using some Chrome extension where I can see all the transfers through TCP, I remember using one but can't recall the name now!!
Thanks a lot
Ricardo

Including DIV elements in Server Side Include Files

Is it a good practice to include DIV container elements in SSI files or should I only put the tags within the DIV container in it. For example in the code below I have a footer which appears under all pages. Should I put only the <p> and <a> elements in the SSI file or <div> elements as well?
<div id="footer">
<div class="container">
<div class="wrapper">
<div id="footer_content">
<p>Copyright 2010 New Life e. V.<br />
Contact |
Find Us |
Impressum</p>
</div>
</div>
</div>
</div>
It will be better to put the whole footer DIV in the include file. Otherwise pages that don't need a footer will also have to carry the unnecessary outer DIVs.