如果您打开computer science category维基百科 ( https://en.wikipedia.org/wiki/Category:Computer_science ),它会显示19子类别 ( https://en.wikipedia.org/wiki/Category:Computer_science )。现在,对于所有这些19子类别,如果我extract只想要页面名称(页面标题)。例如,类别Computer science中的45页面具有显示bullets在维基百科子类别列表下方的页面。现在对于所有其他关联的子类别,例如Areas of computer science是带有3页面的子类别(https://en.wikipedia.org/wiki/Category:Areas_of_computer_science)。但是,它又有 17 个子类别(即深度 1,考虑到遍历,即深度 = 1 意味着,我们是 1 深)。同样,algorithm and data structures(https://en.wikipedia.org/wiki/Category:Algorithms_and_data_structures)有5页面,并且artificial intelligence(https://en.wikipedia.org/wiki/Category:Artificial_intelligence)有333一些额外的页面categories并且subcategories跨越多个页面(参见“人工智能”类别中的页面)有 37 个类别和 333 个页面,这样的列表更深入。我们现在是深度 2。我需要提取深度为 1 和深度为 2 的遍历的所有页面(标题)。是否有任何算法可以实现相同的目标?例如:计算机科学的子类别领域再次有一些(17)子类别,总页数为 5+333+127+79+216+315+37+47+95+37+246+103+21+2 +55+113+94 页考虑所有 (17) 个子类别。这是深度 2,因为我在列表中切换了两次。同样,其余 18 个子类别 ( https://en.wikipedia.org/wiki/Category:Computer_science )需要合并相同的内容,基础根计算机科学的深度为 2?有没有办法实现这一目标?显示和提取这么多数量的页面很困难,因为它会很大。因此,10,000 页的最大阈值绝对没问题。有没有办法做到这一点?任何小的帮助都深表感谢!
添加回答
举报
0/150
提交
取消