zzz projects Html Agility Pack
Home
Documentation Release Notes 3rd Party Libraries Knowledge Base  Help & Donate
Online Examples
  • Home
  • Documentation
  • Release Notes
  • 3rd Party Libraries
  • Knowledge Base
  • Help & Donate
  • Online Examples
  •   Download  

Html Agility Pack - Knowledge Base (KB)

172 results in tag: xpath

html Agility Pack for selecting attribute values

I'm trying to retrieve a specific image from a html document, using html agility pack and this xpath:...//div[@id='topslot']/a/img/@src ...As far as I can see, it finds the src-attribute, but it returns the img-tag. Why is that?...I would expect the Inner...
.net c# html-agility-pack xpath
asked by Vegar

HtmlAgilityPack does not pick childNodes as intended.

I am attempting to use the HtmlAgilityPack library to parse some links in a page, but I am not seeing the results I would expect from the methods. In the following I have a HtmlNodeCollection of links. For each link I want to check if there is an image n...
.net asp.net c# html-agility-pack xpath
asked by Sheff

The example for altering links in HtmlAgilityPack does not work. How do I go about doing this?

The example on ...codeplex... is this :...HtmlDocument doc = new HtmlDocument(); doc.Load("file.htm"); foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"]) { HtmlAttribute att = link["href"]; att.Value = FixLink(att); } doc....
c# html-agility-pack uri xpath
asked by arri.io

proper xpath html nested tables agility pack

Assuming nested tables don't have unique attributes ( id , class or anything else ) to get the required one via ...doc.DocumentNode.SelectSingleNode("//table[@width='500']") ...Does XPath prohibit using table several times in its path ?...foreach (Html...
html html-agility-pack xpath
asked by MicMit

Is there a way to address the issue in HtmlAgilityPack when an html tag isn't closed?

well i have the following problem.... the html i have is malformed and i have problems with selecting nodes using html agility pack when this is the case.... the code is below:...string strHtml = @" <html> <div> <p><strong>Elem_A</strong>String_A1_2...
c# html-agility-pack xpath
asked by Karim

XPath "previously following siblings"

I'm trying to select elements (a) with XPath 1.0 (or possibly could be with Regex) that are following siblings of particular element (b) but only preceed another b element....<img><b>First</b><br>&nbsp;&nbsp; <img>&nbsp;&nbsp;<a href="/first-href">First H...
html-agility-pack xpath
asked by Ondrej Stastny

Html Agility Pack returns all attribute values for a particular tag.

I want to get all values of 'id' attribute of 'span' tag with html agility pack. But instead of attributes I got tags themself. Here's the code ... private static IEnumerable<string> GetAllID() { HtmlDocument sourceDocument = ne...
c# html html-agility-pack xml xpath
asked by StuffHappens

Using XPath, select all links from an HTML table (and HtmlAgilityPack)

What I am trying to achieve is to extract all links with a href attribute that starts with http://, https:// or /. These links lie within a table (tbody > tr > td etc) with a certain class. I thought I could specify just the the a element without the whol...
c# html-agility-pack xpath
asked by Adam Asham

XPATH, HtmlAgilityPack, and Text Extraction

I had been trying to extract links from a class called "tim_new" . I have been given a solution as well....Both the solution, snippet and necessary information is given ...here...The said XPATH query was ..."//a[@class='tim_new']..., my question is, how d...
c# html html-agility-pack xpath
asked by Soham

HtmlAgilityPack has a problem processing the children of a node.

I'm having a problem parsing the input tag children of a form in html. I can parse them from the root using //input[@type] but not as children of a specific node. ...Here's some code that illustrates the problem:...private const string HTML_CONTENT = ...
c# html-agility-pack html-parsing xpath
asked by SteveG

When using HTML Agility Pack to query HTML for ID, an exception occurs.

I'm using the HTML Agility pack to parse an ASPX file inside Visual Studio....I'm searching for an element with a specified ID attribute....The code I'm using is:...var html = new HtmlAgilityPack.HtmlDocument(); html.LoadHtml(docText); if (html.DocumentNo...
html html-agility-pack parsing xpath
asked by awj

Can I choose a node whose next (or previous) sibling meets certain criteria using XPath?

I am reformatting an HTML document using the Agility Pack, and I've run into a limitation of my understanding of XPath....In the document I'm working with, the following is a common construct:...128...2...Which is built like this:...128<img src="" style="...
html html-agility-pack xpath
asked by John Gietzen

Every HTML table row's first and second cell

I'm trying to get just some specific cells in each row using HTMLAgilityPack....foreach (HtmlNode row in ContentNode.SelectNodes("descendant::tr")) { //Do something to first cell //Do something to second cell } ...There are more cells, and each ce...
.net html-agility-pack xpath
asked by peirix

Using XPATH, get the meta tag attribute using HTML Agility Pack.

META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1" /> TITLE>Microsoft Corporation META http-equiv="PICS-Label" content="(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0))" /> META NAME="KEYWORDS" CONTENT="p...
html html-agility-pack xpath
asked by Eugene

"Expression must evaluate to a node-set." error while using XPath

I'm having trouble retrieving a single node by its explicit XPath that I have already found by other ways. I have ...node... and I can get its XPath, but when I try to retrieve that same node again this time via node.XPath it gives the "expression must e...
.net c# html-agility-pack node-set xpath
asked by Snives

How do I count the number of SelectedNodes in C# using XPath?

I am using HTMLAgilityPack in my application, and i want to get the item(node) count of SelectedNodes as the code below:...HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(webBrowser1.DocumentText); var tagListe = doc.Do...
c# count html-agility-pack xpath
asked by caglaror

HTMLAgilityPack XPath syntax to extract URL from HTMLNode?

What is the proper ...XPath... syntax to grab the value of the ...href... attribute from the following ...HTMLNode...:...<a target="_blank" class="monkeys" href="http://someurl.com" id="123"> <span class="title">Monkeys are flying all over!</span> </a...
c# html-agility-pack xpath
asked by Darth Continent

HtmlAgilityPack does not support XPath expressions.

I know it may be of my noobness in XPath, but let me ask to make sure, cuz I've googled enough....I have a website and wanna get the news headings from it: www.farsnews.com (it is Persian)...Using FireBug and FireXpath extensions under firefox and by hand...
c# html-agility-pack xpath
asked by user433556

preceding-sibling Xpath (using HtmlAgilityPack and VB)

Im using HtmlAgilityPack/HAP so that I can use Xpath with HTML documents....I need help selecting the preceding-sibling of ...div class="address"... in this url: ...www.yellowpages.ca/search/si-geo/1/sh/Ottawa,+ON... The sibling that I want is ...h3 class...
html-agility-pack vb.net xpath
asked by Datadayne

Find Comment Node in HTML Agility Pack

I am scraping a website that uses Javascript to dynamically populate the content of a website with the Html Agility pack....Basically, I was searching for the XPATH ..."\\div[@class='PricingInfo']"..., but that div node was being written to the DOM via Ja...
c# html html-agility-pack web-scraping xpath
asked by Abe

Page 1 of 9
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • ยป

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!