Disclaimer: I work on a search engine (findx). I try not to put competitors in a bad light.
Question: Should a web crawler always reveal its true name?
Background: While crawling the web I've found some situations where using a fake user-agent might help. First example is a web site that checks the user-agent in the http-request and returns a "your browser is not supported" - even for robots.txt. Another example is a site that had an explicit whitelist in robots.txt. Strangely, 'curl' was whitelisted but 'wget' was not. I hesitate in using a fake user-agent, e.g. googlebot because it isn't clear what the clueless webmasters' intentions are. It appears that some websites are misconfigured or so google-optimized that other/new search engines may have to resort to faking user-agent.
I'm also puzzled by Qwant because they claim to have their own search index but my personal website (which is clearly indexed when I search in qwant) has never been crawled by a user-agent resembling anything that could lead to qwant. Apparently they don't reveal what their user-agent is: https://blog.qwant.com/qwant-fr/. And there has been some discussion about it: https://www.webmasterworld.com/search_engine_spiders/4743502.htm
This is different from search engines that don't have their own index (eg. DuckDuckGo uses results from Yahoo! and yandex. Startpage uses Google, etc.)
So what do you Soylentils say, is faking the user-agent in webcrawls necessary? Acceptable? A necessary evil?
(Score: 2) by Unixnut on Tuesday July 05 2016, @01:28PM
Thankfully I have not come across this experience yet, I think only once did the bot end up stuck in a bit of a loop, but that was more my poor coding not looking for infinite recursion than anything else. A bug I corrected.
If a site really doesn't want to be spidered that bad, to the point where they redirect to honeypots, then I won't push it further. Using the googlebot user agent works better than a non-googlebot user agent. So for example, if my hit rate goes from 60% to 95% ( -5% who redirect to honeypots, because face it, few people are quite that paranoid ), that is still an improvement.
On a related note, is there some sort of open source bot that I can use/modify, or does everyone just write their own bot, in some awful "lets reinvent the wheel a few hundred times" way? I know some example code out there (indeed what I used initially for mine), but no actual proper project with active development that I can find.
(Score: 3, Insightful) by TheRaven on Tuesday July 05 2016, @01:32PM
sudo mod me up
(Score: 2) by Unixnut on Tuesday July 05 2016, @02:22PM
That would work if I had multiple IPs (I don't), although based on the comments so far here, I may well alter it to randomly select a web browser user agent, and hope that no IDSes out there use pattern matching to see if my "browser" is actually behaving more like a bot than a browser.
Really quite a bit of faff for what used to be really quite simple, crawling web pages.
(Score: 1, Insightful) by Anonymous Coward on Tuesday July 05 2016, @03:50PM
You could try getting a VPN, they're not that expensive and you can usually choose between a few dozen different servers. Gives you a lot of different IP addresses to use.
(Score: 1) by toddestan on Thursday July 07 2016, @02:51AM
If they think you're a VPN a bunch of sites will redirect you to Google's obnoxious recapatcha because they assume you're a bot or up to some other nefarious purpose. You really can't win.
(Score: 1) by isj on Tuesday July 05 2016, @05:56PM
On a related note, is there some sort of open source bot that I can use/modify, or does everyone just write their own bot, in some awful "lets reinvent the wheel a few hundred times" way? I know some example code out there (indeed what I used initially for mine), but no actual proper project with active development that I can find.
We're using a fork of https://github.com/gigablast/open-source-search-engine/ [github.com] The code (C-style C++) is complex and large, but it offers some features that are hard to find in other projects.
Crawling: I'm not aware of any projects specializing in that, but there must be some simple ones out there based on curl/wget and a bolted-on scheduler.
Indexing and searching: If what you intend to index will be relatively uniform and comparable (and spam-free) and word order does not matter to you, then any of the engines supporting BM25 are faster and simpler.