Re:Data-Mining Wikipedia for Fun and Profit
by whall6 on Thursday August 19, 2021 @11:06AM
(#28234773)
Genuine question from a non-programmer: why? Is it because the volume of requests increases load on the servers/costs?
[ Parent
| on HN ]
Re:Data-Mining Wikipedia for Fun and Profit
by michaelbuckbee on Thursday August 19, 2021 @11:10AM
(#28234828)
That's part of it, but also it's typically much more difficult and there's an element of "why are you making this so much harder on yourself".
Re:Data-Mining Wikipedia for Fun and Profit
by billpg on Thursday August 19, 2021 @11:15AM
(#28234911)
(Author of original article here.)
That's the great thing about HtmlAgilityPack, extracting data from HTML is really easy. I might even say even easier than if I had the page in some table-based data system.
Re:Data-Mining Wikipedia for Fun and Profit
by SlimyHog on Thursday August 19, 2021 @11:19AM
(#28234969)
The HTML is more volatile and subject to change than other sources though
Re:Data-Mining Wikipedia for Fun and Profit
by FalconSensei on Thursday August 19, 2021 @12:32PM
(#28235923)
Don't remember the last time wikipedia changed the infobox though
Re:Data-Mining Wikipedia for Fun and Profit
by jcun4128 on Thursday August 19, 2021 @11:55AM
(#28235438)
Can make it even harder, use Puppeteer to take screenshots then pass it to an OCR to get the text.
Re:Data-Mining Wikipedia for Fun and Profit
by nonameiguess on Thursday August 19, 2021 @11:20AM
(#28234989)
Unlike APIs, html class/tag names or whatever provide no stability guarantees. The site owner can break your parser whenever they want for any reason. They can do that with an API, but usually won't since some guarantee of stability is the point of an API.
Re:Data-Mining Wikipedia for Fun and Profit
by billpg on Thursday August 19, 2021 @02:23PM
(#28237376)
True, but the analysis was done on files downloaded over the span of two or three days. If someone had decided to change the CSS class of an infobox during that time, I'd have noticed, investigated and adjusted my code appropriately.
Re:Data-Mining Wikipedia for Fun and Profit
by pigsonthewing on Friday August 20, 2021 @08:19AM
(#28245199)
"html class/tag names or whatever provide no stability guarantees"
Not quite. Many Wikipedia infoboxes (and some other templates) use standardised class names from microformats such as hCard:
Re:Data-Mining Wikipedia for Fun and Profit
by matkoniecz on Thursday August 19, 2021 @11:36AM
(#28235190)
Scrapping, especially on a large scale, can put a noticeable strain on servers.
Bulk downloads (database dumps) are much cheaper to serve for someone crawling millions of pages.
It gets even more significant if generation of reply is resource intensive (not sure is Wikipedia qualifying for that but complex templates may cause this).