> As most companies need to extract product data on a daily basis, waiting a couple days for your engineering team to fix any broken spiders isn’t an option. When these situations arise, Scrapinghub uses a machine learning based data extraction tool that we’ve developed as a fallback until the spider has been repaired. I once worked on a spider that crawled article content and I ran into the same problem. I always wa…
I've had the same idea, it kind of sounds like the obvious thing to do... That said, i haven't found a need to do that yet to verify the idea itself. Maybe that is similar to what they do using their "ML approach" mentioned?
Lessons learned scraping 100B product pages
41–50 of 99 posts
Re: Lessons learned scraping 100B product pages
#42Earlier quoted context omitted.
Any further information on this? Last I looked (which was a while ago), the infrastructure like HTML parsers seemed surprisingly tricky in Elixir.
The only complication is if you want to use Meeseks ( https://github.com/mischov/meeseeks ) which requires the Rust compiler and runtime be installed because it has native bindings. Meeseks is useful because it's a bit faster than the default Floki ( https://github.com/philss/floki ) and because it can handle very malformed HTML. As for Elixir itself, here's a quick example: ``` # Assume this contains 1000 URLs urls…
The better handling of malformed HTML by default is the much bigger deal.
Re: Lessons learned scraping 100B product pages
#43Earlier quoted context omitted.
If you are anticipating a 'no' then you definitely should ask for permission. The only valid reason for starting a large scraping operation is because you can argue that permission would be granted anyway.
Well I am not arguing that point because I am not doing unethical scraping anyway. Just trying to explain why most scrapers go to hammering the servers directly. Additionally, in my local market the owners of e-commerce websites are extremely narrow-minded and have zero tech education so all they will ever hear from you is "I want to steal that guy's data" which is of course not true at all. But try and argue with a…
Re: Lessons learned scraping 100B product pages
#44> As most companies need to extract product data on a daily basis, waiting a couple days for your engineering team to fix any broken spiders isn’t an option. When these situations arise, Scrapinghub uses a machine learning based data extraction tool that we’ve developed as a fallback until the spider has been repaired. I once worked on a spider that crawled article content and I ran into the same problem. I always wa…
Creating a domain-specific model can be done a million ways, obviously, but the nice thing about HTML is the markup gives hints all along the way. The tree, the class names, the tags, etc. Coupled with the content of each tag, it's absolutely possible to determine collections of items with metadata using ML.
But like most ML problems, the underlying data that feeds the model is the time-consuming part.
If you are working in a single or few domains, I 100% recommend this approach. If you're scraping something far more generalized, first you need to have models that you care about and then you need to create models to determine the content type of what you're scraper is looking at.
1) What kind of content do I have? 2) Does this match a known domain with a model? 3) Apply appropriate model to domain, hopefully extract correct data
Another huge issue is, of course, validation, because you're going to be dealing with an inordinate amount of unknown and unpredictable data depending on what you're looking at.
Re: Lessons learned scraping 100B product pages
#45Re: Lessons learned scraping 100B product pages
#46> As most companies need to extract product data on a daily basis, waiting a couple days for your engineering team to fix any broken spiders isn’t an option. When these situations arise, Scrapinghub uses a machine learning based data extraction tool that we’ve developed as a fallback until the spider has been repaired. I once worked on a spider that crawled article content and I ran into the same problem. I always wa…
If it really works 100% of the time then probably. A lot sites though use multiple markup styles for seemingly no reason though. E.g. if you created an account before a certain date then your profile keeps the old HTML, even though the old pages look identical to the new pages.
Re: Lessons learned scraping 100B product pages
#47I've always wondered if it makes more sense to render the page as a jpeg and run some kind of machine learning to identify and read off the relevant details
There's a lot of very bad HTML out there.
Re: Lessons learned scraping 100B product pages
#48"Multi-threading is a must, when scraping at scale." I disagree on this point. Starting with a single threaded model allowed my team to scale quickly and with little additional overhead. What we have lost with performance we gained in simplicity and developer productivity. That being said tuning and porting portions of the app to a multi-threaded system is slotted to take place within the next year. Start with single…
Or use a language where fully utilizing all CPU cores is transparent, like Elixir? There's zero complexity, you basically add 4-5 lines of code and that's it. Honestly, not exaggerating. I've done several very amateur scrapers in the last several years, I am never going back to languages with a global interpreter lock, ever.
Now that I think about it, it's even less than 4 lines:
from multiprocess.pool import Pool (or ThreadPool)
pool = Pool()
pool.map(scrape, urls)
Re: Lessons learned scraping 100B product pages
#49> As most companies need to extract product data on a daily basis, waiting a couple days for your engineering team to fix any broken spiders isn’t an option. When these situations arise, Scrapinghub uses a machine learning based data extraction tool that we’ve developed as a fallback until the spider has been repaired. I once worked on a spider that crawled article content and I ran into the same problem. I always wa…
Suppose alternatively that I have previously shown the status as "available" or "out of stock" and now I change it for some products to "no longer available". Can your system handle those edge cases?
Re: Lessons learned scraping 100B product pages
#50Earlier quoted context omitted.
You can just remove them from DOM or hide with CSS.
What about e.g. http://discourseontheotter.tumblr.com/ ? Edit: In the UK I see this: https://imgur.com/a/zlWOByh
Of course if I was actually trying to read the link I would have to give up, because there appears to be no way to navigate through and opt out.