anduin2017 / hsharp Goto Github PK
View Code? Open in Web Editor NEWHSharp is a library used to analyse markup language like HTML easily and fastly.
License: MIT License
HSharp is a library used to analyse markup language like HTML easily and fastly.
License: MIT License
var httpService = new HTTPService(null); var strData =await httpService.Get(new Aiursoft.Pylon.Models.AiurUrl("https://bsaber.com/"),false); var htmlDoc= HtmlConvert.DeserializeHtml(strData);
就解析 https://bsaber.com/ 这个网站 DeserializeHtml 一直不返回,测试过最长时间 大概 10分钟
nuget上最新的版本
大佬您好,经常在油管看到您的视频学习,受益匪浅
我也是一名C# .NET 的死忠粉
看到项目比较感兴趣,拜读了一下您的代码
关于HDoc获取元素的地方,略有不同看法,请允许在下想发表一点愚见。
在解析时候,是否应该除List以外,再用一个Dictionary来做索引,
以提高按名称查找的效率,
每次都Children.Find(t => t.TagName == tagName);
会全局遍历,元素多的时候是否会性能不佳呢。
关于索引器中的处理,HTag this[string tagName],HTag this[int tagIndex]
这2个索引器中没有做任何异常处理,如果是示例中的连续调用(newDocument["html"]["head"]["meta",0])
如果填错了名字或者索引,造成了空指针或者越界异常,不太容易查找错误地点。
是否应该throw明确的异常信息,是哪个名字错了,或者哪个索引错了。
可能是我个人的爱好
个人感觉["meta"][0], 要比["meta",0], 更具有可读性。
感谢up主的无私奉献,但是今天在使用过程中遇到些问题,麻烦up主帮忙看看如何解决,问题如下:
环境:win10, c#, visual studio 2019, 项目基于.net framework4.0
html字符串:<table><tr><td>6</td></tr></table>
此时使用Doc["table"]["tr"]["td"].Son
获取数字6的时候报错:System.ArgumentOutOfRangeException:“索引超出范围。必须为非负值并小于集合大小。
,研究了好久,发现如果html标签的innertext字符串长度小于2,就会报错。拿此例来说,如果td标签里的Innertext是60或者06就没问题。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.