FatTony
FatTony
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
@Pobiega @canton7 ❤️ got it!!!! thanks so much!
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
Ah amazing! I'll try that 🙂
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
What's that link?
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
I can, I do need to configure my lsp a lil better, true. Just haven't gotten around to it yet 😆
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
Thanks for the tip 🙂
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
Ok ok, this is for a Job Interview exercise and I was getting a bit stuck. I just need something that works by tonight and tomorrow if I can make it better, then I'll spend some time improving my solution.
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
Yh, I'm using LSP but tbh omnisharp is not fantastic in Linux
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
I'm running on vim 🙃 I got a couple Properties i'm gonna try printing
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
Ah ok, so how do I extract the href?
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
using System;
using HtmlAgilityPack;
class Program
{

static void Main(string[] args)
{
// Use HAP to fetch html from web.
var link = "https://www.abs.gov.au/statistics/labour/employment-and-unemployment/labour-force-australia";
HtmlWeb web = new HtmlWeb();
var htmlDoc = web.Load(link);
var latest = htmlDoc.DocumentNode.SelectNodes("//*[@id=\"block-views-block-topic-releases-listing-topic-latest-release-block\"]/div/div/div/div/a");
latest.ToList().ForEach(i=>Console.WriteLine(i.InnerText));
}
}
using System;
using HtmlAgilityPack;
class Program
{

static void Main(string[] args)
{
// Use HAP to fetch html from web.
var link = "https://www.abs.gov.au/statistics/labour/employment-and-unemployment/labour-force-australia";
HtmlWeb web = new HtmlWeb();
var htmlDoc = web.Load(link);
var latest = htmlDoc.DocumentNode.SelectNodes("//*[@id=\"block-views-block-topic-releases-listing-topic-latest-release-block\"]/div/div/div/div/a");
latest.ToList().ForEach(i=>Console.WriteLine(i.InnerText));
}
}
Ok, so this finds the node, but it prints the text inside the link instead of the link, how can I extract the link?
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
That's fine, I think. All i need is the link for the next page, and do the same after. I need to parse through a couple of HTML pages and get a download link afterwards
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
Let me check if that was the issue, thanks
42 replies
CC#
Created by FatTony on 2/4/2024 in #help
✅ Parsing a Link from an HTML file with HTMLAgilityPack
Oh I am very regarded....
42 replies