我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

从GoLang的Wikipedia解析S&P 500数据

I am trying to figure out how to parse the table of S&P 500 stock from this page: https://en.wikipedia.org/wiki/List_of_S%26P_500_companies.

Python has nice libraries like lxml that help to take care of this but I'm trying to do the same thing in GoLang. I have already looked into making GET requests with "net/http" but am not sure how to perform the actual parsing.

Thank you.

I'd use this lib: https://github.com/PuerkitoBio/goquery

It gives you easy to use jquery like selectors.

I made an example with your data: http://play.golang.org/p/KdWUiiPxSU

近期文章

  • 使用Go进行POST失败,但可以使用curl
  • 去os.Truncate()不重置文件光标
  • 如果在Go中构造,则无法初始化struct
  • 如何在Go程序中内部存储文本?
  • 如何检测interface {}是否为指针?
  • 字符串中允许多个参数[Go]
  • GoLang:调用nil对象的方法时感到恐慌
  • 创建一个不写入标准输出的用户提示
  • 如何创建包含唯一字符串的数组?
  • 访问结构字段时Golang结构文字和指针之间的区别
  • Go或Rust中的数组数组?
  • 我不能在golang中使用变量进行时间计算吗? [重复]
  • 终止第二个goroutine
  • 在Golang中分配值
  • GO lang异常处理
  • 未命名结构类型的方法
  • 我如何开始使用Go? [关闭]
  • 用Go中的函数创建方法的简单方法是什么?
  • GoLang:在Go中进行类型继承和转换的内存分配
  • golang json marshal将标签转换为utf符号

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华