How to detect which ecommerce software is being used

时间:2016-08-31 12:24:53

标签: c# asp.net web-scraping web-crawler e-commerce

I am making an webcrawler in C# which needs to find webshops. The problem i'm having is that I need to detect if the webpage is a webshop. If it is I need to find out what type of e-commerse software it is using. But the problem is that I don't know how you can detect it in the source code.

I also have just a Chrome plugin called builtwith which can detect all kinds of software. But I have yet to find out how they are doing that.

It would be nice if someone could help me with this problem

2 个答案:

答案 0 :(得分:0)

在给出实际答案之前,值得注意的是,您提出的建议可能会违反许多网站的使用条款。您应该花时间调查您可能会对自己和您的组织承担哪些法律责任。

这将是一项耗费大量时间的工作,但并不困难。您的爬虫只需要使用基于规则的方法来检测页面有效负载中的签名。

  1. 找到您想要检测的特定软件。
  2. 找到2-3个肯定使用该软件的网站。
  3. 查看HTML有效内容,了解他们在网站上常见的脚本,CSS和HTML模式。
  4. 构建基于代码的规则,可以一致地检测这些模式。例如: private function countArrayElements(&$array, &$previous){ // get collection of subnodes foreach ($array as $node){ $name = $this->stripNamespace($node['name']); // get count of distinct subnodes if (empty($result[$name]["max_count"])){ $result[$name]["max_count"] = 1; } else { $result[$name]["max_count"]++; } // recurse if (is_array($node['value'])){ $result[$name]["elements"] = $this->countArrayElements( $node['value'], $result[$name]["elements"] ); } // compare previous max if (!empty($previous[$name]["max_count"])){ $result[$name]["max_count"] = max( $previous[$name]["max_count"], $result[$name]["max_count"] ); } } return $result; }
  5. 测试您确定使用该软件的更多网站上的模式。
  6. 对每个软件供应商重复。
  7. 当目标有多个版本并且您需要调整规则以了解和了解各种版本,或者平台非常相似时,会发生更复杂的事情。

    我认为最复杂的部分是有一个经过深思熟虑的机器人问题检测,报告和限制架构。你应该把大部分时间花在计划上。

    那就是它。

答案 1 :(得分:0)

有两种方法可以确定网站使用的技术。首先,如果您精通技术,则可以右键单击电子商务页面(目录,结帐页面等),然后查看源代码。许多平台的源代码中都会包含一些提示,这些提示可以让您大致了解该网站的运行情况。

您还可以查看DNS /托管信息,这将帮助您确定是托管电子商务解决方案还是SaaS(例如Shopify)。

您也可以尝试使用InterNIC并输入域名。结果将返回可以指导您正确使用名称服务器。

最后,如果所有这些侦查似乎都太困难了,那么有一种更简单的方法!尝试BuiltWith。只要您要查找的系统不是自定义/专有的,它通常是相当可靠的。在BuiltWith中输入一个域,它将向您显示平台,使用的小部件,分析和跟踪代码,CDN,CMS,付款处理器等。

相关问题