4 ms·
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 real
by julienfr112 9y ago
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.
- porker 9y ago> (parsing json, making screenshot then ocr to get position of text, even fasttext !) Really interested to hear how you use fasttext for this?
- julienfr112 9y agoI'll make a HN post about that. Though, don't hold your breath until it happens.