Questions tagged [html-agility-pack]

HTML Agility Pack is an open-source HTML parser that builds a read/write DOM and supports Linq, plain XPATH or XSLT.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
41 views

Remove contents by range selection between two markers within HTML in C#

I have a C# automation app for parsing/manipulating html contents. The problem is to remove contents between two string markers (currently using HtmlAgilityPack library). Example content: <div ...
Zukaru's user avatar
  • 328
0 votes
0 answers
17 views

C# How to iterate in all TR & TD of multiple html table and extract value

I want to parse multiple html table using htmlagility pack. i want to iterate in all TD and extract values. please have a look at this url https://www.sec.gov/Archives/edgar/data/1108134/...
Sankar's user avatar
  • 11
-1 votes
1 answer
30 views

document.DocumentNode.QuerySelectorAll does not retrun anything

I try to access the "div.prod_inner" on the following homepage (see image) for web scraping. I use the HtmlAgilityPack and the code works on another homepage and also on "div.lay_main&...
Flisp's user avatar
  • 9
1 vote
0 answers
37 views

Saving HTML as XHTML in .NET 6

I need to convert a html File to XHTML in C# .NET 6. Is there any simple way to do it? What i tried so far was using HtmlAgilityPack and set OptionOutputAsXml = true like so: var htmlDoc = new ...
CrazyEight's user avatar
3 votes
1 answer
95 views

HTML Agility Pack not matching xpath where attribute name starts-with

I am trying to select all HTML nodes where the node contains an attribute with a name starting with 'on'. This is what I have for the XPath: //*[@*[starts-with(name(), 'on')]] I am getting null back ...
Kenshin's user avatar
  • 91
0 votes
0 answers
46 views

HtmlAgilityPack not getting all the tables

using this code and I am trying to get all of the HTML Tables. One of the table is commented out <!--<table>, I want to include that in the output. When I do this logic I am only seeing one ...
Jefferson's user avatar
  • 127
0 votes
0 answers
30 views

parsing a table using html agility pack in unity?

I am not a programmer so i have no experience. the issue is that I managed to parse some information from this website text but the table at the bottom that has the Announcement Date and the rest of ...
moe SOLO's user avatar
0 votes
0 answers
31 views

Extracting and parsing information from a website using html-agility-pack

The next code extracts from the link https://www.ncbi.nlm.nih.gov/myncbi/1dAdNxivfiO5l/bibliography/public/ a website that has a list of citations. My end goal is to extract that information and ...
Jose Cabrera Zuniga's user avatar
0 votes
1 answer
126 views

How to load a WebView2 document into HtmlAgilityPack

I can't figure out how to load a WebView2 document into HTML Agility Pack. I'm using JavaScript to get the DOM as a string. However, when I load the DOM string into an HtmlAgilityPack document, ...
Pan ache's user avatar
  • 123
0 votes
1 answer
28 views

Why HtmlAgilityPack doesn't see the body in some EPUB documents

I'm trying to parse EPUB documents (opened with VersOne.Epub) using HtmlAgilityPack, and it started off working, but as I test more, it starts missing body in some books. As originally I tested ...
khantazm's user avatar
1 vote
0 answers
39 views

Unable to extract all paragraph tags from HTML document using Html Agility Pack

I am trying to get all <p></p> from an HTML document using Html Agility Pack. However, when I try below, all the nodes are null. var doc = new HtmlDocument(); doc.Load(@"c:\Webs\test....
Max's user avatar
  • 480
1 vote
1 answer
50 views

How can I scrape data from a dynamic table using HTMLAgilityPack and C#

I have been trying numerous methods over the last few days to extract data from a table: The Link to the website. This is one version of code I found online and adapted. I have tried many methods ...
Doug's user avatar
  • 13
0 votes
0 answers
19 views

HtmlAgilityPack - Surround HtmlNode Collection with HtmlNode

In my C# .NET 6 Application i have the following html structure <div id="111">Div1</div> <div id="222">Div2</div> <div id="333">Div3</div&...
CrazyEight's user avatar
1 vote
1 answer
65 views

How can I read a web page with Html Agility Pack

I want to read a web page by this library but some page has a script that in first level run script ( for example Welcome or site is loading or … ) then in second level show page content. And in this ...
Mostafa Miri's user avatar
0 votes
1 answer
24 views

How to select node where descendant node has attribute

I am parsing an html email. I need to get the href property from the following html: <a href="https://sample.com/us/en/suv-rental/united-states/orlando-fl/jeep/grand-cherokee/12345" ...
Greg Gum's user avatar
  • 34.2k
0 votes
1 answer
55 views

Which approach for injecting urls in text?

I have a task using c#. It's part of an existing web forms project. What I want to do is: inside the page's <main></main> tag (which has a runat="server"), find the <a><...
John Ohara's user avatar
  • 2,851
0 votes
2 answers
55 views

XPath html nodes with custom namespace attributes

I use c# .NET 6 with HtmlAgilityPack Nuget Package version 1.11.46 installed and i am facing the following problem: <span my:fdivid="1">Test1</span> // should be selected <...
CrazyEight's user avatar
0 votes
0 answers
13 views

Cant webscrape all values from a list when using full xpath

im pretty sure i know the issue but cant get the syntax right. My c# webscrapper. Is grabbing a random list of people from wikipedia. I used get full xpath to get the data HtmlNode[] nodes = ...
user avatar
5 votes
2 answers
621 views

Receive 403 error when attempting to scrape page

my code below uses C# and HTMLAgilityPack to scrape a webpage and then uses WebClient to download a string from another webpage. This works great on localhost, but when I publish my code as an API ...
Jakal's user avatar
  • 62
0 votes
0 answers
34 views

Load HTML after page load

I have htmltable like this the image below. My task is to export the table to excel. After the table bind, I use HTML agility pack together to scrape the table. So my code is like below Dim ...
Afiq's user avatar
  • 27
1 vote
2 answers
75 views

HtmlAgilityPack - Select descendant until element with class

I'm using HtmlAgilityPack in my C# application to scrape some HTML code. But I'm having issues selecting a particular tag. This is the HTML that I have: <div class="Post"> <img ...
Olote's user avatar
  • 39
0 votes
0 answers
85 views

AngleSharp parsing - Tables and duplicate label/value data names

<tr><td class='separator' style="background-color:#000000;" colspan = '2'></td></tr> <tr><td colspan='2' style="border-color:#000000;background-color:#...
sam's user avatar
  • 1
0 votes
1 answer
58 views

How to obtain table data from a website that is hidden using selenium and c#?

I'm trying to scrape the following website and extract the table data of products using selenium in c# but when I want to parse the HTML result, I can't find the table. It seeems the table is loaded ...
S.Parseh's user avatar
0 votes
2 answers
37 views

htmlagilitypack website datatable extract data

Yes, I have searched the web and stackoverflow. I am having trouble extracting data from a table from a website. I can retrieve the full table with code below, but need to extract select data: Url = &...
Erik's user avatar
  • 73
0 votes
0 answers
118 views

Replace node with text in PowerHTML (HTML Agility Pack)

I would like to look for placeholder nodes (<pagetitle>) and replace them with a text string in PowerShell with PowerHTML. This is my HTML: <html> <head> <meta http-...
Diego Schiavon's user avatar
0 votes
1 answer
34 views

Problem getting my application to log into webpage

The "*" are my credentials to log in, and are set to variables. When I run the code, my returned value is a string stating my conditional statement, else value. I am pretty sure I am ...
ワッツアンドレ's user avatar
-1 votes
1 answer
57 views

Why changing a form graphic property will affect the software?

Description: I create a VB.NET Windows Forms application [.net6+] that loads an HTML file using the HtmlAgilityPack library, extracts data from it, and displays it in a list box. The form contains two ...
Mattia's user avatar
  • 258
0 votes
1 answer
66 views

Filtering results given html file

I'm trying to filter results by some criteria having a big html. I don't know if what I am trying to ask is achievable, but it costs nothing to ask. I'm playing a browser game which as a big map ...
Mattia's user avatar
  • 258
0 votes
1 answer
90 views

Replace multiple p tags containing line breaks or non breaking spaces with a single line break using HTML Agility Pack

How can I remove multiple "empty p tags" or "p tags containing a non breaking space" or a "p tag containing a line break" and replace with a "single p tag containing ...
WebFletch's user avatar
  • 172
0 votes
0 answers
54 views

HtmlAgilityPack parsing page with template variables

I want to get the "href" attribute of some "link" tags: var linkTags = doc.DocumentNode.SelectNodes("//link[@href]"); var sources = linkTags.Select(t => t....
Endy Tjahjono's user avatar
0 votes
1 answer
54 views

HtmlAgilityPack throws stackoverflow exception when calling OuterHtml

var doc = new HtmlDocument(); var table = HtmlNode.CreateNode("table"); var tbody = HtmlNode.CreateNode("tbody"); table.AppendChild(tbody); doc.DocumentNode.AppendChild(table); var ...
MyDaftQuestions's user avatar
0 votes
1 answer
205 views

How can I extract the headers from multiple HTML tables using C# HTMLAgilityPack?

I'm trying to iterate through each table, and extract the headers of each table separately. This is what I've got so far, but whenever I run this it seems to be extracting the header of all tables per ...
Abdul's user avatar
  • 27
0 votes
0 answers
54 views

HTML Agility Pack cannot find specific node

In my html I have node named music-detail-header. My HTML: <music-detail-header image-src="https://m.media-amazon.com/images/I/51du+vdj5WL.jpg" image-dimen="1:1" primary-text=&...
freaklessgamer's user avatar
0 votes
2 answers
59 views

crawling price gives null , HtmlAgilityPack (C#)

Im trying to get stock data from a website with webcrawler as a hobby project. I got the link to work, i got the Name of the stock but i cant get the price... I dont know how to handle the html code. ...
Mnda90's user avatar
  • 47
0 votes
1 answer
75 views

Get Custom Html tag using HTML Agility Pack c#

Given I have the following HTML, how can I use HTML Agility Pack to get the value 18.2099 I had a look at the following How get a custom tag with html agility pack? but that did not work. <div ...
R4nc1d's user avatar
  • 2,953
0 votes
1 answer
57 views

Does HtmlAgilityPack implement the standard HTML5 parsing algorithm?

When I parse an HTML5 document such as: <p>Content</p> using HtmlAgilityPack with default options, it parses it successfully, but the constructed HtmlDocument does not include the <...
Michael Kay's user avatar
0 votes
1 answer
403 views

Using HtmlAgilityPack with C# to find all href links within td elements in html page

I am attempting to use HtmlAgilityPack package to find each of the href links within td tags throughout an entire html page. The trick is that these tables start deep down into the html structure. I ...
Blake Rivell's user avatar
  • 13.3k
0 votes
0 answers
114 views

Can't load an URL using HtmlAgilityPack for particular website in C#(.NET)

I need to web scrape a website so I can download few things off of it. I have noticed that I can load an URL easily from most websites but not the one I need. Here's a code snippet that works and ...
Никола Јовановић's user avatar
0 votes
0 answers
23 views

How To Join Two xPaths In One Single Collection?

var processorTitles = document.DocumentNode.SelectNodes("//div[@class='pad-hrz-xs']/a[@data-zone='title']"); var processorsPrices = document.DocumentNode.SelectNodes("//div[@class='card-...
VLAD_W47FK's user avatar
0 votes
0 answers
86 views

How to scraping lazy loading webpage? C#, HtmlAgilityPack

I'm trying to parse a music playlist from a website. It's now takes only 15 items (regardless of whether I scroll down or up) but needs to be 50. Is it possible to force the load of lazyloading ...
Andrii Chepeliuk's user avatar
0 votes
0 answers
160 views

Scrape `HTTPS` websites with HTTP proxy using HttpClient

I am trying to scrape an https website using http proxy provided here https://hidemy.name/en/proxy-list/?country=US&type=hs#list The website I am trying to scrape is also https://hidemy.name/en/...
emhsmath's user avatar
0 votes
1 answer
69 views

Use Html Agility Pack to download Bitcoin Price (C#)

I need to get bitcoin price from https://coinmarketcap.com/currencies/bitcoin/ using Html Agility Pack. I am using this example which works fine: var html = @"http://html-agility-pack.net/"; ...
ForTheHorde's user avatar
0 votes
1 answer
200 views

HTMLAgilityPack - Get only the Head information without the body

I need to get a few meta tags from websites. The HTMLAgilityPack is excellent for that. My only issue is that it gets the entire website and filters through it. I was wondering if there was a way only ...
Nick202's user avatar
  • 23
0 votes
0 answers
40 views

Load view-source:myURL in Selenium 4 and get page source

Using selenium 4 webdriver and .Net 6, I got: webDriver.Navigate().GoToUrl('https://example.com'); string pageSource_1= webDriver.PageSource; In order to load the page content quickly and no need to ...
ehsan_kabiri_33's user avatar
0 votes
1 answer
96 views

Replace href inside <!--[if mso]> tags using HtmlAgilityPack

we are using the following code to replace href values, which works great: foreach (HtmlNode link in doc.DocumentNode.SelectNodes("//a[@href]")) { HtmlAttribute att = link.Attributes[&...
xnetdude's user avatar
  • 159
-1 votes
1 answer
63 views

what is missing for DocumentNode function to show text in datagridview?

What i´m trying to do is to use the documentnode method to find a specific table from the internet and put it into datagridview. My code can be seen below: ` List<string> list = new List<...
DynamicHelp's user avatar
0 votes
1 answer
46 views

HTML Agility can't parse <span> when it changes

I am trying to parse the price of a currency pair using HTML Agility Pack, i am able to parse the price when it is first parsed but the prices changes regularly. string asset = cmbPair....
SA_'s user avatar
  • 7
0 votes
1 answer
474 views

How should I use HtmlAgilityPack to scrape a table on a website?

I need to scrape a table from a website with C# and export the data into pgadmin as a database that would store the data for usage later on. I´ve tried to use different methods that I have seen on the ...
Sketchup Galaxy's user avatar
1 vote
1 answer
228 views

How to select element based on ID and gt all the InnerHtml using HTML Agilitypack

I need to pull part of html from external url to another page using agility-pack. I am not sure if i can select a node/element based on id or classname using agility pack. So far i manage to pull ...
Learning's user avatar
  • 19.5k
-1 votes
1 answer
299 views

How to get only human-visible text from page C# with HTMLAgilityPack?

I tried to get only visible text from page, split it and return array of words on the page. My code: public async Task<string[]> GetText(string link) { string htmlSource = await httpClient....
RainbowFire's user avatar

1
2 3 4 5
70