I have done a lot of scraping in Python with requests and lxml and never really understood what scrapy offers beyond that. What are the main features that can't be easily implemented manually?
Pluggable parsers, automatically good error handling and spidering functionality (finding and queueing new links to scrape), great logging, progress stats, exports, pause/resume functionality, and a million other goodies that are seemingly "trivial" but really you don't want to rewrite them every time you write a scraper. edit: Especially if your scraping jobs take a LONG time - days and weeks, this stuff is extra ha…
Web Scraping: Bypassing “403 Forbidden,” captchas, and more
121–130 of 232 posts
Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#122Earlier quoted context omitted.
I think such laws are wrong. Scraping is what Google and Web Archive does and it serves good purposes. For example, one can make an application that compares prices for the same item at different internet shops and helps to find the cheapest offer. I don't understand what's wrong with downloading the information that is published on a public web server. That is what that server was made for in the first place. Of cou…
I disagree. The person who owns the server should get to decide who has access and under what circumstances. Joe Scraper, having invested nothing, has no claim or rights to it whatsoever. Furthermore, the fact that the server gives 200 responses is not sufficient implied permission IF a no-scraping policy has been communicated in some other way such as robots.txt or (clearly communicated) TOS. The techno-nihilist arg…
Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#123Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#124Note that 99% of time, if a web page is worth scraping, it probably has an accompanying mobile app. It's worth downloading the app and running mitmproxy/burp/charles on the traffic to see if it uses a private API. In my experience, it's much easier to scrape the private mobile API than a public website. This way you get nicely formatted JSON and often bypass rate limits.
Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#125Proposition: 99% of scraping use cases are eliminated if the scraper agrees to subsequently abide by the target's terms of service.
Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#126Earlier quoted context omitted.
You reverse engineer the application, or you run it in a debugger. If the app features certificate pinning to block MITM eavesdropping through your own proxy, you either use one of the XPosed Framework libraries that removes it on the fly in a process hook, or you decompile the app, return-void the GetTrustedClient, GetTrustedServer, AcceptedIssuers, etc. functions. If it features HMAC signing, you decompile the app,…
Know of any good guides on doing this? I want to do this for an app right now actually.
Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#127Earlier quoted context omitted.
The initial idea was to make your life simpler by parsing JSON instead of HTML. Now we are decompiling binaries. Somewhere on the way, we got lost.
Once you do the one-time work of pulling out the key, you can just add something like, "secret_key=foobar" to your requests, and you're back to happily parsing JSON. If they keep changing it up, I'm sure you could automate the decompiling process. The reality is that this technique is security by obscurity at its core, and is therefore never going to succeed.
Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#128Re: Web Scraping: Bypassing “403 Forbidden,” captchas, and more
#129Note that 99% of time, if a web page is worth scraping, it probably has an accompanying mobile app. It's worth downloading the app and running mitmproxy/burp/charles on the traffic to see if it uses a private API. In my experience, it's much easier to scrape the private mobile API than a public website. This way you get nicely formatted JSON and often bypass rate limits.