V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
meteor2013
V2EX  ›  PHP

请问怎么去抓一个 wiki 页面上的单词。

  •  1
     
  •   meteor2013 · 2015-03-07 04:51:44 +08:00 · 2065 次点击
    这是一个创建于 3357 天前的主题,其中的信息可能已经有所发展或是发生改变。
    比如这个页面,
    https://en.wikipedia.org/wiki/List_of_medical_symptoms

    怎么去抓上面列出的单词:

    比如:
    abdomen
    back
    chest
    head
    limb - arm, hand, foot or leg
    neck
    。。。

    一直到最后的

    vaginal bleeding in early pregnancy / miscarriage
    vaginal bleeding in late pregnancy
    vaginismus
    4 条回复    2015-03-07 06:38:03 +08:00
    msg7086
        1
    msg7086  
       2015-03-07 05:09:06 +08:00
    简单说。正则表达式。
    meteor2013
        2
    meteor2013  
    OP
       2015-03-07 05:22:31 +08:00
    能说具体点吗?
    ligyxy
        3
    ligyxy  
       2015-03-07 06:13:19 +08:00
    https://developer.yahoo.com/yql/

    例子就和你的需求很像了
    blacktulip
        4
    blacktulip  
       2015-03-07 06:38:03 +08:00
    $("#mw-content-text ul li a").each(function(index, element) {
    console.log(element.text);
    });

    多了几个少了几个,手动调整一下吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5740 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 08:38 · PVG 16:38 · LAX 01:38 · JFK 04:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.