V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
Esay
V2EX  ›  分享创造

BeautifuSoup Helper - 制作爬虫小帮手,看看 find 选中了啥

  •  
  •   Esay · 2014-03-01 12:31:07 +08:00 · 3738 次点击
    这是一个创建于 3703 天前的主题,其中的信息可能已经有所发展或是发生改变。
    使用 BeautifulSoup 感觉不够直观,就写了一个的小工具,给选中的部分加上一个红框,欢迎大家使用、修改。



    Source: https://github.com/Jeswang/beautiful-soup-helper
    PS: 运行 Python 程序的部分用了 @binux 的一些代码,代码写得很规范,学到了很多,在这里特别感谢。
    7 条回复    2014-05-26 19:23:26 +08:00
    xiaozi
        1
    xiaozi  
       2014-03-01 12:48:33 +08:00
    直接使用chrome的xpath插件就可以了
    9hills
        2
    9hills  
       2014-03-01 13:12:44 +08:00 via iPad
    嗯,chrome能直接得到xpath简直不要太赞,直接用lxml就好了
    binux
        3
    binux  
       2014-03-01 14:17:56 +08:00   ❤️ 1
    https://gist.github.com/binux/9286057

    还是css选择器语法简单
    Esay
        4
    Esay  
    OP
       2014-03-01 22:07:17 +08:00
    @binux

    @xiaozi @9hills 确实好用,多谢推荐。有的时候还会需要想用用熟悉的 BeautifulSoup 嘛。
    wangfeng3769
        5
    wangfeng3769  
       2014-05-26 17:02:19 +08:00
    @Esay xp 下运行是不是有问题呀,老鸨内存泄漏问题。
    wangfeng3769
        6
    wangfeng3769  
       2014-05-26 17:12:14 +08:00
    Traceback (most recent call last):
    File "E:\beautiful-soup-helper-master\beautiful-soup-helper-master\src\soup_helper.py", line 198, in <module>
    dialog = MainWindow(None, "Soup Helper")
    File "E:\beautiful-soup-helper-master\beautiful-soup-helper-master\src\soup_helper.py", line 63, in __init__
    self.Bind(html2.EVT_WEB_VIEW_LOADED, self.LoadHTMLFihish, self.browser)
    AttributeError: 'module' object has no attribute 'EVT_WEB_VIEW_LOADED'
    swig/python detected a memory leak of type 'wxPyXmlSubclassFactory *', no destructor found.
    Esay
        7
    Esay  
    OP
       2014-05-26 19:23:26 +08:00
    额 搜索了一下,试下?

    http://stackoverflow.com/questions/16460545/wxpython-passing-user-datas-to-html2

    EVT_WEB_VIEW_LOADED -> EVT_WEBVIEW_LOADED

    另外,Chrome 的 copy xpath 确实好用,也推荐你试试。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2754 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:44 · PVG 13:44 · LAX 22:44 · JFK 01:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.