tabletojson

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 3 Imported by: 0

README

Table To Json Go Report Card

Attempts to convert HTML tables into JSON.

Example

package main

import (
    "fmt"
    "github.com/yigit433/tabletojson-go"
    "net/http"
)

func main() {
    res, err := http.Get("https://www.doviz.com/kripto-paralar")
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()
	if res.StatusCode != 200 {
		log.Fatalf("status code error: %d %s", res.StatusCode, res.Status)
	}

    tables, err := tabletojson.Convert(res.Body)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(tables)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	ParentName  string `json:"parentName,omitempty"`
	ParentValue string `json:"parentValue,omitempty"`
}

type Row

type Row []Column

type Table

type Table []Row

func Convert

func Convert(reader io.ReadCloser) ([]Table, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL