News for hackers. Stuff that matters.
Re:Toapi – Let any web site provide APIs by julienfr112 on Tuesday January 09, 2018 @03:21PM (#16109627)
I think it's what in french we call a <i>fausse bonne idée</i>, or good idea at first sight only.

I scrapped many site, and making an api out of a site is really similar to web scrapping. Despite having tried many time to create an universal scrapper, or at least a helper class for scrapping, I found out that restarting from scratch at each site was the best strategy.

There is a lot of info on stackoverflow about that, and there was a post specifically on this issue but i can't find it.

Maybe one third of the time, everything is ok and I use my favorite tools : python-requests with requests_cache for connection and lxml for parsing. Then, Toapi should work. But there is so much variety in internet site that most of the time, i end up doing something else : Use other way to get the data (websocket, phantomjs, chromeheadless, or going through proxy or Tor or anything ...). Use other data extraction methods, because xpath does not works (parsing json, making screenshot then ocr to get position of text, even fasttext !). Some time there is encoding issue. Some time html is malformated. In this 2/3 of the case, Toapi won't work out of the box. So you will trying to fix it, improve it, etc, and the code base of Toapi will grow but it will never handle all the case.

Re:Toapi – Let any web site provide APIs by porker on Tuesday January 09, 2018 @05:34PM (#16110785)
> (parsing json, making screenshot then ocr to get position of text, even fasttext !)

Really interested to hear how you use fasttext for this?

Re:Toapi – Let any web site provide APIs by julienfr112 on Wednesday January 10, 2018 @04:39AM (#16113658)
I'll make a HN post about that. Though, don't hold your breath until it happens.