Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个爬虫,我只想使用美国域。例如,我想要:
http://thenorthface.com/
但我不想:
http://uk.thenorthface.com or http://se.thenorthface.com/
有谁知道这样做的方法或执行此操作的 perl 模块?我知道这可以用正则表达式来完成,但我试图避免收集所有外国域开头的列表......非常感谢!
您无法从 URL 可靠地确定“美国”域是什么。甚至不清楚“美国域”这个词有什么意义。
例如,许多美国州的缩写也是 ISO-3166 国家代码。你将如何处理ar.xyz.com。是阿肯色州还是阿根廷?怎么样ma.pdq.com......马萨诸塞州或摩洛哥(法语中的摩洛哥)?
ar.xyz.com
ma.pdq.com
您可以将二级域链接到一个国家(至少对于总部),但主机名和三级域将无法分类。