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.
3,400
questions
2
votes
0
answers
38
views
Moving Node from one doc to another modifies original doc?
Running into an odd issue, and not too sure why. Dumbed down code is below, having a simple console project with the below code will cause it to happen in my dev system:
static void Main(string[] args)...
0
votes
0
answers
20
views
HTMLAgilityPack Why are Attributes not correctly encoded after reading Utf-8 Encoded File
I am reading a HTML file that is utf-8 encoded:
htmlDocument = new HtmlDocument();
htmlDocument.Load( filePath );
The file contains a valid <meta charset="UTF-8"> tag, and after ...
0
votes
0
answers
34
views
Download File From Website with URL Authentifikation C#
I am trying to download a file from one of this sites:
1cloudfile
bowfiles
games-database
Mainly games-database.com
I think all of this sites are using a similar System
For example games-database....
0
votes
1
answer
25
views
Retrieve data from html string HtmlAgilityPack C#
I was scraping data from a webpage using HtmlAgilityPack with this code
string Name= "ARKU2215462";
string containerInfo = LoadContent(Name);
HtmlAgilityPack.HtmlDocument doc = new ...
0
votes
1
answer
44
views
Scrape data from web page with HtmlAgilityPack c#
I had a problem scraping data from a web page which I got a solution
Scrape data from web page that using iframe c#
My problem is that they changed the webpage which is now https://webportal.thpa.gr/...
1
vote
0
answers
52
views
Download File from MegaUP C#
I want to download a file from this site: https://megaup.net in C#
I tried to use HtmlAgilityPack to search for something in the webpages html.
You can find a function that uses 4 parameters
...
0
votes
0
answers
33
views
HtmlAgilityPack Scrape table from website
I am learning how to use HtmlAgilityPack and I cannot find any documentation on scraping tables in the way I need.
My table looks like this
| | NAME | PRICE ...
0
votes
0
answers
22
views
c# Remove html body's numeric symbol code from html agility pack inner text
I would like to know if there are any ways to remove numeric symbol codes(such as [) from inner text retrieved from site node using html agility pack.
Programming language: C#
Below is the ...
1
vote
0
answers
15
views
My XPath with double slash always selects same element from HtmlAgilityPack result [duplicate]
I'm trying to scrap the list of music for a given date from the billboard website. When I obtain a list of div for each music I'm trying to get the title and the artist for each div, but in my foreach ...
1
vote
1
answer
36
views
How to get values from website using HTMLNode and HtmlAgility-Pack in C#
I'm trying to get data from this website
I want to get: Level, Vocation and Name from the table.
They are located directly in tr class -> td. How can I get those informations out?
This is how data ...
1
vote
2
answers
42
views
How to get first occurence of src with HTML Agility Pack
due to invalid formatting of xmls I have, I'm using HTML Agility Pack.
I am parsing for example this feed: https://www.rioseo.com/feed/
I have an array of these elements (so the "src" are ...
1
vote
0
answers
21
views
How to scrap data from web in Windows Forms use html agility pack? How to get correct Xpath?
I don't know what is wrong with this code. I can't see result in textBox.
Somebody can check if the XPath is correct? And where is mistake??
namespace Pogoda
{
public partial class Form2 : Form
{
...
0
votes
0
answers
46
views
How to display int from web page (webscraping) in TextBox
I need somebody who tell me how to use Html Agility Pack in Windows Forms.
I have
`private void btnOnet_Click(object sender, EventArgs e)
{
HtmlAgilityPack.HtmlDocument doc = new ...
2
votes
0
answers
24
views
How to check if a list contains htmlnode?
I am making a program that actively searches for content addition to a site and then write out to the console information about the content. I have an HtmlNode List containing all new content and ...
1
vote
2
answers
57
views
Problem httpClient.GetStringAsync(URI) load
I have a problem of load with this method. In fact, I want to load a webpage to get the Html code. But the webpage doesn't have the time to load completely. So I want to add a thread.sleep() to this ...
0
votes
0
answers
31
views
Reading content from .html file with content type xml
I'm trying to read content from .htm file with content type of xml but it always gives me unexpected output. I'm trying with htmlagility pack and System.IO.File.ReadAllText.
the output which I get ...
0
votes
0
answers
24
views
VB Net HtmlAgility can't pass next xpath / empty blank result
I can't pass the next xpath using htmlagility vbnet, innertext blank. and please explain. this is bug?
https://dotnetfiddle.net/swXn7f
2
votes
0
answers
49
views
Can not Load HTML doc from docker container
I wrote a simple scraper that takes a URL and scrapes just one Xpath from that document.
In the local machine, it works perfectly fine, but after building as a docker image and running up in a docker ...
0
votes
0
answers
28
views
Collecting data from Ebay using Xpath and HtmlAgiltyPack
Hey I'm trying to get the text value of the following html element Ebay Website + Dev Tool
The XPath expression for the price seems to work fine and I get the price of the product from the site, but ...
1
vote
1
answer
51
views
Cant get Innertexts from webpage using html agility pack xpath in c#
So this is my code guys.
Im trying to get the text inside a span and storage it locally. Im using html agility pack and trying to retrieve the text using xpath but the nodes dont retrieve anything and ...
0
votes
1
answer
40
views
On error Console.WriteLine C# HtmlAgilityPack
I am new to C# and find it difficult to output the result of a search with HtmlAgilityPack.
I would like to show "Not found" when the requested search cannot be found.
The thing is, I cannot ...
0
votes
0
answers
29
views
Html Agility Pack not seen a button
I am trying to capture the href of a button using the following code
HtmlWeb webGet = new HtmlWeb();
webGet.UseCookies = true;
ServicePointManager.SecurityProtocol = ...
0
votes
2
answers
59
views
Cannot get li that belong to a specific ul
I have a structure like this:
<ul>
<li class="list-group-item px-0">
<h2>Foo</h2>
<ul>
<li class="list-group-item"&...
0
votes
1
answer
42
views
Trying to get word count using HtmlAgilityPack, but node list is returning as null
I have the following code that grabs the nodes with text for certain descendants of specific tags/classes, and it was working before, but I haven't ran this program in a couple of months (nobody else ...
0
votes
1
answer
49
views
HTML Agility Pack foreach loop not iterating for data grid (C#)
I'm a beginner programmer working on a small webscraper in C#. The purpose is to take a hospital's public website, grab the data for each doctor, their department, phone and diploma info, and display ...
0
votes
0
answers
40
views
HTML Agility Pack not catching error in malformed HTML
I am working with HTML Agility Pack to validate HTML is valid before sending out a well formed or a malformed email.
The code I am testing with currently is
void Main()
{
var htmlDoc = new ...
0
votes
0
answers
50
views
HTMLAgilityPack set input into text field, then scrape results? C#
What I am trying to do is making it so that I can start my program, and in a textbox, I enter something I would like to search. This then loads a a web page i have defined, finds the search field on ...
1
vote
0
answers
67
views
Scraping Text from secure web page? (C#)
Basically the site I am trying to scrape text from is secure and only accessible to those on what i can assume is the VPN the organization has set.
When I was testing my tool today, while connected to ...
-2
votes
1
answer
47
views
Select text strings with multiple formatting tags within
Context:
VB.NET application using htmlagility pack to handle html document.
Issue:
In a html document, I'd like to prefixe all the strings starting with # and ending with space by an url whatever ...
0
votes
0
answers
32
views
HtmlAgilityPack not all child nodes are listed
Im getting not all Child nodes, even though in the Website itself they are listed. It only lists two of the Child nodes.
The Child nodes of the tr Element I want to get
It gets the correct tr nodes I ...
1
vote
1
answer
78
views
How to find a unique string within html and wrap it with a tag, but exclude links and urls
I'm looking for a way to look for a specific string within a page in the visible text and then wrap that string in <em> tags. I have tried used HTML Agility Pack and had some success with a ...
0
votes
0
answers
45
views
The request was aborted: The connection was closed unexpectedly on HtmlAgilityPack when performing multiple pages request
I am getting The request was aborted: The connection was closed unexpectedly
while performing multiple pages request for webscraping. I am new to HtmlAgilityPACK please help
if (WebSearchURL....
0
votes
0
answers
27
views
Obtain HTML hidden by aria-expanded attribute
I am trying to download the contents of a webpage using HTML-Agility-Pack.
On the website there is a button that once clicked reveals some more information. This button sets an aria-expanded attribute ...
0
votes
0
answers
49
views
How do I scrape web content async?
Here is what I tried so far. This works but the Form is Freezing everytime it updates
private void timer1_Tick(object sender, EventArgs e)
{
HtmlAgilityPack.HtmlWeb web = new ...
-1
votes
1
answer
70
views
How can I parse repeated HTML elements by their class attribute?
I'm trying to parse an HTML file with basically the same tags.
I want to get this output:
BTC - Bitcoin, BEP20(BSC), Bitcoin(Segwit)
ETH - ERC20, BEP20(BSC), POLYGON, ARBITRUM, AURORA, MATISEVM
USDT -...
0
votes
0
answers
18
views
How can I set a heading structure with children via HTML Agility Package in Asp Core 3.1?
public List<HtmlNode> GetHeadersFromBlogHTML(string html)
{
var doc = new HtmlDocument();
doc.LoadHtml(html);
var xpath = "//*[self::h1 or self::h2 or self::h3 ...
0
votes
0
answers
28
views
Convert an InternetExplorer.Application object to HtmlAgilitypack element
I need to open a web page which takes some time to load and then read data from the HTML. I used this :
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ie = ...
0
votes
1
answer
42
views
Why HtmlAgilityPack adds some characters to my html
Here is my code:
Dim input = "<div><textarea>something</div></textarea>"
Dim doc As New HtmlAgilityPack.HtmlDocument
doc.OptionOutputAsXml = True
doc.LoadHtml(...
0
votes
1
answer
21
views
Html Agility Pack search all nodes and save them
I shall search over whole website entries with "00:00-00:01" and replace with "" , like below.
<td id="tb"> Fr, 3.Sep.2021 00:00-00:01 </td>...<td id=&...
0
votes
0
answers
14
views
HtmlAgilityPack - Wait for javascript to run [duplicate]
I'm trying to get info off of a webpage using the HtmlAgilityPack in c#. My issue is that the page I'm trying to get info from loads a preliminary static page and then updates it with a .js script a ...
0
votes
1
answer
31
views
Why do I get ' when typing ' in HTMLAgilityPack (.NET)
I am using HTMLAGilityPack to edit web page, and it seems I am getting quotes replaced with ' or " etc.
Why is this happening and how to fix?
-2
votes
1
answer
74
views
Why does HTMLAgilityPack remove my closing tag?
Using htmlagilitypack in .NET (C#) and have some html code as such:
<p><ol><li>A bunch of text</li></ol><em>some em text</em> more text here.</p>
I ...
1
vote
1
answer
66
views
How to get innertext into array to add custom tags around the elements in HTMLAgilityPack
I want to be able to add custom tags around just text, so say I have a node:
<p>Some text <img src="" /> more text </p>
How can I get my custom tags around 'Some text' and ...
0
votes
0
answers
91
views
I am trying to extract links in a loop using HTML Agility Pack
I am trying to extract the links of a URL by using HTML Agility Pack first I am trying to enter my first URL and it is extracting the link but in the second step I want to extract the links of all ...
1
vote
1
answer
65
views
How to substring html string based on div id
If I have a string in html format like this:
<p style="text-align:center"> </p>
<p style="text-align:center"> </p>
<p style="text-...
0
votes
0
answers
44
views
Navigate through table pagination with Html Agility Pack (HAP)
I have this table which I'm already accessing all elements that can be seen on first page, but I have no idea how to navigate through the next pages, as the data from them are not present in the ...
0
votes
1
answer
96
views
Html Agility not working with a string from an async method
I'm trying to get the HTML of a website that is javascript heavy, then use HtmlAgilityPack to analyze the HTML received.
I am getting the desired response, however, when trying to load the data using ...
0
votes
1
answer
50
views
How can I remove the spaces in html tags if tags only contain whitespace? using HTMLAgility C#
<p style="text-align:right;margin-bottom:0pt;margin-top:0pt;text-indent:0%;font-family:Times New Roman;font-size:11pt;"> </p>
here you can see the space inside the p tag, want to ...
0
votes
1
answer
23
views
Why doesn't htmlagilitypack include attribute when creating a new node?
using .Net and htmlagilitypack. Trying to put outer tag on a node as such ('item' in the loop is the one of the found 'section' tags):
<section aria-label="Tables">...</section>
...
0
votes
1
answer
67
views
How to parse an html node containing multiple tags?
I'm able to reach the node I want to extract but couldn't figure out how to separate different tags within the node.
p.s. I'm OK with regular expression; just curious if a simpler way with Html ...