Code Monkey home page Code Monkey logo

go-htmltable's People

Contributors

dependabot[bot] avatar nfx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-htmltable's Issues

panic: runtime error: index out of range [1] with length 1

๐Ÿ‘‹ Hey this looks like an awesome tool!

I needed something like this a couple of weeks ago and would love to see this working!

Unfortunately the first URL I tried resulted in a panic.

playground link

Not sure if it was because there are multiple tables on the page? Or maybe I misunderstood the API, let me know if there is a better way I should set this up to get it working.

Stack trace

2022/10/15 18:34:16 found table columns=[Model Code name Released CPU support Fab(nm) FSB/HT(MHz) Southbridge Features / Notes] count=7
2022/10/15 18:34:16 found table columns=[Model AMD480Xchipset(originally CrossFire Xpress 1600) Model RD480 Model Oct 2006 Model Athlon 64,Sempron Model 110 Model 1000(HT 2.0) Model No
 Model x8 + x8 Model SB600,ULi-M1575 Model ? Codename Released CPU support Fab(nm) HT(MHz) IGP CrossFire Southbridge Features / Notes] count=26
2022/10/15 18:34:16 found table columns=[Model Codename Released CPU support Fab(nm) HT(MHz) AMD-V(Hardware Virtualization) IGP CrossFire SLI[5] TDP(W) Southbridge Features / Notes] co
unt=13
2022/10/15 18:34:16 found table columns=[Model AMD 640 chipset Model AMD-645 Model 1997 Model  Model  Model  Model 2 ร— ATA/33 Model  Codename Released Fab(nm) USB2.0 + 1.1 Audio Parall
el ATA1 Features / Notes] count=14
2022/10/15 18:34:16 found table columns=[Model Codename Released Fab(nm) SATA USB2.0 + 1.1 Parallel ATA1 RAID NIC Package TDP(W) Features / Notes] count=12
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/nfx/go-htmltable.(*Page).finishTable(0xc000207d18)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:273 +0x867
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc0004e80e0)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:219 +0x427
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc00026bce0)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:222 +0x45a
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc00026bc70)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:222 +0x45a
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc00026b500)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:222 +0x45a
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc00026aee0)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:222 +0x45a
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc00026acb0)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:222 +0x45a
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc000226a10)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:222 +0x45a
github.com/nfx/go-htmltable.(*Page).parse(0xc000207d18, 0xc000226930)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:222 +0x45a
github.com/nfx/go-htmltable.(*Page).init(0x68d300?, {0x7f3d447d5830?, 0xc00049c180?})
        GOPATH/pkg/mod/github.com/nfx/[email protected]/page.go:186 +0x57
github.com/nfx/go-htmltable.NewSlice[...]({0x71c310, 0xc00001a100?}, {0x7f3d447d5830?, 0xc00049c180?})
        GOPATH/pkg/mod/github.com/nfx/[email protected]/slice.go:17 +0x90
github.com/nfx/go-htmltable.NewSliceFromResponse[...](0x6b0fb8?)
        GOPATH/pkg/mod/github.com/nfx/[email protected]/slice.go:30 +0x8c
github.com/nfx/go-htmltable.NewSliceFromURL[...]({0x6b0fb8, 0x407ab9?})
        GOPATH/pkg/mod/github.com/nfx/[email protected]/slice.go:43 +0xc8
main.main()
        HOME/intros/html-tables/main.go:23 +0x30
exit status 2

Go version

go1.19.1 linux/amd64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.