dennisgorelik: 2020-06-13 in my home office (Default)
[personal profile] dennisgorelik
PostJobFree crawler found web page that causes fatal crash in AngleSharp parser:
using AngleSharp.Parser.Html;
.....
string pageHtml = LoadUrlContent("http://onestop.fiu.edu/financial-aid/loans/")
var parser = new HtmlParser();
var document = parser.Parse(pageHtml);
document.QuerySelectorAll("a"); // Fatal crash: "An unhandled exception of type 'System.StackOverflowException' occurred in AngleSharp.dll".

We cannot catch that exception and it simply restarts the whole process (PostJobFreeService Windows service).
That is very frustrating.

In development environment that crash is not always reproducible.
When we run code above in test - it just works.
But if we run the same code under Visual Studio debugger - it crashes with 'System.StackOverflowException'.

Update:
https://github.com/AngleSharp/AngleSharp/issues/523
AngleSharp library maintainers noticed that problematic page contains a lot of "<content /><content /><content /><content />" attributes.
view-source:http://onestop.fiu.edu/financial-aid/loans/

Obviously it is not an excuse to fail. Hopefully their latest build would fix the problem.

Date: 2017-01-28 01:42 am (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Вот такие у них парсеры. Я бы поэкспериментировал. И, кстати, есть и другие варианты, селениум, например, когда живую страницу сканишь с помощью простого джаваскрипта (тот же querySelectorAll).

Date: 2017-01-28 04:11 pm (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
У Сишарпа.
Экспериментировать, например, с селениумом. Надежность у него не 100%, конечно. Производительность тоже не супер.

Но есть одно важное свойство - страница у него живая, а не как у тебя, когда просто по url считывается страница. Нынче же хитро, single-page app с джаваскриптом кругом.

Date: 2017-01-28 06:46 pm (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Это понятно, что не сам сишарп. А проблемы с программистами на нем. Джава - те же проблемы.

Profile

dennisgorelik: 2020-06-13 in my home office (Default)
Dennis Gorelik

June 2025

S M T W T F S
1234 567
891011 12 13 14
15161718192021
22232425262728
2930     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 6th, 2025 03:39 am
Powered by Dreamwidth Studios