How to use HTML method of rod Package

Best Rod code snippet using rod.HTML

query_test.go

Source:query_test.go Github

copy

Full Screen

1package rod_test2import (3 "context"4 "errors"5 "testing"6 "time"7 "github.com/go-rod/rod"8 "github.com/go-rod/rod/lib/cdp"9 "github.com/go-rod/rod/lib/defaults"10 "github.com/go-rod/rod/lib/proto"11 "github.com/go-rod/rod/lib/utils"12 "github.com/ysmood/gson"13)14func TestPageElements(t *testing.T) {15 g := setup(t)16 g.page.MustNavigate(g.srcFile("fixtures/input.html"))17 g.page.MustElement("input")18 list := g.page.MustElements("input")19 g.Eq("input", list.First().MustDescribe().LocalName)20 g.Eq("submit", list.Last().MustText())21}22func TestPagesQuery(t *testing.T) {23 g := setup(t)24 b := g.browser25 b.MustPage(g.srcFile("fixtures/click.html")).MustWaitLoad()26 pages := b.MustPages()27 g.True(pages.MustFind("button").MustHas("button"))28 g.Panic(func() { rod.Pages{}.MustFind("____") })29 g.True(pages.MustFindByURL("click.html").MustHas("button"))30 g.Panic(func() { rod.Pages{}.MustFindByURL("____") })31 _, err := pages.Find("____")32 g.Err(err)33 g.Eq(err.Error(), "cannot find page")34 g.Panic(func() {35 pages.MustFindByURL("____")36 })37 g.Panic(func() {38 g.mc.stubErr(1, proto.RuntimeCallFunctionOn{})39 pages.MustFind("button")40 })41 g.Panic(func() {42 g.mc.stubErr(1, proto.RuntimeCallFunctionOn{})43 pages.MustFindByURL("____")44 })45}46func TestPagesOthers(t *testing.T) {47 g := setup(t)48 list := rod.Pages{}49 g.Nil(list.First())50 g.Nil(list.Last())51 list = append(list, &rod.Page{})52 g.NotNil(list.First())53 g.NotNil(list.Last())54}55func TestPageHas(t *testing.T) {56 g := setup(t)57 g.page.MustNavigate(g.srcFile("fixtures/selector.html"))58 g.page.MustElement("body")59 g.True(g.page.MustHas("span"))60 g.False(g.page.MustHas("a"))61 g.True(g.page.MustHasX("//span"))62 g.False(g.page.MustHasX("//a"))63 g.True(g.page.MustHasR("button", "03"))64 g.False(g.page.MustHasR("button", "11"))65 g.mc.stubErr(1, proto.RuntimeCallFunctionOn{})66 g.Err(g.page.HasX("//a"))67 g.mc.stubErr(1, proto.RuntimeCallFunctionOn{})68 g.Err(g.page.HasR("button", "03"))69}70func TestElementHas(t *testing.T) {71 g := setup(t)72 g.page.MustNavigate(g.srcFile("fixtures/selector.html"))73 b := g.page.MustElement("body")74 g.True(b.MustHas("span"))75 g.False(b.MustHas("a"))76 g.True(b.MustHasX("//span"))77 g.False(b.MustHasX("//a"))78 g.True(b.MustHasR("button", "03"))79 g.False(b.MustHasR("button", "11"))80}81func TestSearch(t *testing.T) {82 g := setup(t)83 p := g.page.MustNavigate(g.srcFile("fixtures/click.html"))84 el := p.MustSearch("click me")85 g.Eq("click me", el.MustText())86 g.True(el.MustClick().MustMatches("[a=ok]"))87 _, err := p.Sleeper(rod.NotFoundSleeper).Search("not-exists")88 g.True(errors.Is(err, &rod.ErrElementNotFound{}))89 g.Eq(err.Error(), "cannot find element")90 // when search result is not ready91 {92 g.mc.stub(1, proto.DOMGetSearchResults{}, func(send StubSend) (gson.JSON, error) {93 return gson.New(nil), cdp.ErrCtxNotFound94 })95 p.MustSearch("click me")96 }97 // when node id is zero98 {99 g.mc.stub(1, proto.DOMGetSearchResults{}, func(send StubSend) (gson.JSON, error) {100 return gson.New(proto.DOMGetSearchResultsResult{101 NodeIds: []proto.DOMNodeID{0},102 }), nil103 })104 p.MustSearch("click me")105 }106 g.Panic(func() {107 g.mc.stubErr(1, proto.DOMPerformSearch{})108 p.MustSearch("click me")109 })110 g.Panic(func() {111 g.mc.stubErr(1, proto.DOMGetSearchResults{})112 p.MustSearch("click me")113 })114 g.Panic(func() {115 g.mc.stubErr(1, proto.RuntimeCallFunctionOn{})116 p.MustSearch("click me")117 })118}119func TestSearchElements(t *testing.T) {120 g := setup(t)121 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))122 {123 res, err := p.Search("button")124 g.E(err)125 c, err := res.All()126 g.E(err)127 g.Len(c, 4)128 g.mc.stubErr(1, proto.DOMGetSearchResults{})129 g.Err(res.All())130 g.mc.stubErr(1, proto.DOMResolveNode{})131 g.Err(res.All())132 }133 { // disable retry134 sleeper := func() utils.Sleeper { return utils.CountSleeper(1) }135 _, err := p.Sleeper(sleeper).Search("not-exists")136 g.Err(err)137 }138}139func TestSearchIframes(t *testing.T) {140 g := setup(t)141 p := g.page.MustNavigate(g.srcFile("fixtures/click-iframes.html"))142 el := p.MustSearch("button[onclick]")143 g.Eq("click me", el.MustText())144 g.True(el.MustClick().MustMatches("[a=ok]"))145}146func TestSearchIframesAfterReload(t *testing.T) {147 g := setup(t)148 p := g.page.MustNavigate(g.srcFile("fixtures/click-iframes.html"))149 frame := p.MustElement("iframe").MustFrame().MustElement("iframe").MustFrame()150 frame.MustReload()151 el := p.MustSearch("button[onclick]")152 g.Eq("click me", el.MustText())153 g.True(el.MustClick().MustMatches("[a=ok]"))154}155func TestPageRace(t *testing.T) {156 g := setup(t)157 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))158 p.Race().Element("button").MustHandle(func(e *rod.Element) { g.Eq("01", e.MustText()) }).MustDo()159 g.Eq("01", p.Race().Element("button").MustDo().MustText())160 p.Race().ElementX("//button").MustHandle(func(e *rod.Element) { g.Eq("01", e.MustText()) }).MustDo()161 g.Eq("01", p.Race().ElementX("//button").MustDo().MustText())162 p.Race().ElementR("button", "02").MustHandle(func(e *rod.Element) { g.Eq("02", e.MustText()) }).MustDo()163 g.Eq("02", p.Race().ElementR("button", "02").MustDo().MustText())164 p.Race().MustElementByJS("() => document.querySelector('button')", nil).165 MustHandle(func(e *rod.Element) { g.Eq("01", e.MustText()) }).MustDo()166 g.Eq("01", p.Race().MustElementByJS("() => document.querySelector('button')", nil).MustDo().MustText())167 raceFunc := func(p *rod.Page) (*rod.Element, error) {168 el := p.MustElement("button")169 g.Eq("01", el.MustText())170 return el, nil171 }172 p.Race().ElementFunc(raceFunc).MustHandle(func(e *rod.Element) { g.Eq("01", e.MustText()) }).MustDo()173 g.Eq("01", p.Race().ElementFunc(raceFunc).MustDo().MustText())174 el, err := p.Sleeper(func() utils.Sleeper { return utils.CountSleeper(2) }).Race().175 Element("not-exists").MustHandle(func(e *rod.Element) {}).176 ElementX("//not-exists").177 ElementR("not-exists", "test").MustHandle(func(e *rod.Element) {}).178 Do()179 g.Err(err)180 g.Nil(el)181 el, err = p.Race().MustElementByJS(`() => notExists()`, nil).Do()182 g.Err(err)183 g.Nil(el)184}185func TestPageRaceRetryInHandle(t *testing.T) {186 g := setup(t)187 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))188 p.Race().Element("div").MustHandle(func(e *rod.Element) {189 go func() {190 utils.Sleep(0.5)191 e.MustElement("button").MustEval(`() => this.innerText = '04'`)192 }()193 e.MustElement("button").MustWait("() => this.innerText === '04'")194 }).MustDo()195}196func TestPageElementX(t *testing.T) {197 g := setup(t)198 g.page.MustNavigate(g.srcFile("fixtures/selector.html"))199 g.page.MustElement("body")200 txt := g.page.MustElementX("//div").MustElementX("./button").MustText()201 g.Eq(txt, "02")202}203func TestPageElementsX(t *testing.T) {204 g := setup(t)205 g.page.MustNavigate(g.srcFile("fixtures/selector.html"))206 g.page.MustElement("body")207 list := g.page.MustElementsX("//button")208 g.Len(list, 4)209}210func TestElementR(t *testing.T) {211 g := setup(t)212 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))213 el := p.MustElementR("button", `\d1`)214 g.Eq("01", el.MustText())215 el = p.MustElement("div").MustElementR("button", `03`)216 g.Eq("03", el.MustText())217 p = g.page.MustNavigate(g.srcFile("fixtures/input.html"))218 el = p.MustElementR("input", `submit`)219 g.Eq("submit", el.MustText())220 el = p.MustElementR("input", `placeholder`)221 g.Eq("blur", *el.MustAttribute("id"))222 el = p.MustElementR("option", `/cc/i`)223 g.Eq("CC", el.MustText())224}225func TestElementFromElement(t *testing.T) {226 g := setup(t)227 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))228 el := p.MustElement("div").MustElement("button")229 g.Eq("02", el.MustText())230}231func TestElementsFromElement(t *testing.T) {232 g := setup(t)233 p := g.page.MustNavigate(g.srcFile("fixtures/input.html"))234 el := p.MustElement("form")235 list := p.MustElement("form").MustElements("option")236 g.Len(list, 4)237 g.Eq("B", list[1].MustText())238 g.mc.stubErr(1, proto.RuntimeCallFunctionOn{})239 g.Err(el.Elements("input"))240}241func TestElementParent(t *testing.T) {242 g := setup(t)243 p := g.page.MustNavigate(g.srcFile("fixtures/input.html"))244 el := p.MustElement("input").MustParent()245 g.Eq("FORM", el.MustEval(`() => this.tagName`).String())246}247func TestElementParents(t *testing.T) {248 g := setup(t)249 p := g.page.MustNavigate(g.srcFile("fixtures/input.html"))250 g.Len(p.MustElement("option").MustParents("*"), 4)251 g.Len(p.MustElement("option").MustParents("form"), 1)252}253func TestElementSiblings(t *testing.T) {254 g := setup(t)255 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))256 el := p.MustElement("div")257 a := el.MustPrevious()258 b := el.MustNext()259 g.Eq(a.MustText(), "01")260 g.Eq(b.MustText(), "04")261}262func TestElementFromElementX(t *testing.T) {263 g := setup(t)264 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))265 el := p.MustElement("div").MustElementX("./button")266 g.Eq("02", el.MustText())267}268func TestElementsFromElementsX(t *testing.T) {269 g := setup(t)270 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html"))271 list := p.MustElement("div").MustElementsX("./button")272 g.Len(list, 2)273}274func TestElementTracing(t *testing.T) {275 g := setup(t)276 g.browser.Trace(true)277 g.browser.Logger(utils.LoggerQuiet)278 defer func() {279 g.browser.Trace(defaults.Trace)280 g.browser.Logger(rod.DefaultLogger)281 }()282 p := g.page.MustNavigate(g.srcFile("fixtures/click.html"))283 g.Eq(`rod.element("code") html`, p.MustElement("html").MustElement("code").MustText())284}285func TestPageElementByJS(t *testing.T) {286 g := setup(t)287 p := g.page.MustNavigate(g.srcFile("fixtures/click.html"))288 g.Eq(p.MustElementByJS(`() => document.querySelector('button')`).MustText(), "click me")289 _, err := p.ElementByJS(rod.Eval(`() => 1`))290 g.Is(err, &rod.ErrExpectElement{})291 g.Eq(err.Error(), "expect js to return an element, but got: {\"type\":\"number\",\"value\":1,\"description\":\"1\"}")292}293func TestPageElementsByJS(t *testing.T) {294 g := setup(t)295 p := g.page.MustNavigate(g.srcFile("fixtures/selector.html")).MustWaitLoad()296 g.Len(p.MustElementsByJS("() => document.querySelectorAll('button')"), 4)297 _, err := p.ElementsByJS(rod.Eval(`() => [1]`))298 g.Is(err, &rod.ErrExpectElements{})299 g.Eq(err.Error(), "expect js to return an array of elements, but got: {\"type\":\"number\",\"value\":1,\"description\":\"1\"}")300 _, err = p.ElementsByJS(rod.Eval(`() => 1`))301 g.Eq(err.Error(), "expect js to return an array of elements, but got: {\"type\":\"number\",\"value\":1,\"description\":\"1\"}")302 _, err = p.ElementsByJS(rod.Eval(`() => foo()`))303 g.Err(err)304 g.mc.stubErr(1, proto.RuntimeGetProperties{})305 _, err = p.ElementsByJS(rod.Eval(`() => [document.body]`))306 g.Err(err)307 g.mc.stubErr(4, proto.RuntimeCallFunctionOn{})308 g.Err(p.Elements("button"))309}310func TestPageElementTimeout(t *testing.T) {311 g := setup(t)312 page := g.page.MustNavigate(g.blank())313 start := time.Now()314 _, err := page.Timeout(300 * time.Millisecond).Element("not-exists")315 g.Is(err, context.DeadlineExceeded)316 g.Gte(time.Since(start), 300*time.Millisecond)317}318func TestPageElementMaxRetry(t *testing.T) {319 g := setup(t)320 page := g.page.MustNavigate(g.blank())321 s := func() utils.Sleeper { return utils.CountSleeper(5) }322 _, err := page.Sleeper(s).Element("not-exists")323 g.Is(err, &utils.ErrMaxSleepCount{})324}325func TestElementsOthers(t *testing.T) {326 g := setup(t)327 list := rod.Elements{}328 g.Nil(list.First())329 g.Nil(list.Last())330}...

Full Screen

Full Screen

use_gorod.go

Source:use_gorod.go Github

copy

Full Screen

...104 headElement := page.MustElement("head")105 // prevent execution of tracking such as google analytics, gtm, or facebook106 // let's start by scanning the head section107 for _, s := range headElement.MustElements("script") {108 if strings.Contains(s.MustHTML(), "googletagmanager.com") {109 s.MustRemove()110 }111 }112 bodyElement := page.MustElement("body")113 bodyElement.MustElement("noscript").MustRemove()114 err = addScriptTagToBody(page, jsInjection)115 //err = page.AddScriptTag("", jsInjection) // this one adding script tag on head section116 if err != nil {117 _, _ = fmt.Fprint(w, "")118 return119 }120 wait()121 page.MustWaitIdle().MustElement("body.page-completed")122 htmlRootElement, err2 := bodyElement.Parent()123 if err2 != nil {124 _, _ = fmt.Fprint(w, "")125 return126 }127 htmlResult := htmlRootElement.MustHTML()128 //_ = ioutil.WriteFile("rendered.html", []byte(htmlResult), os.ModePerm)129 _, _ = fmt.Fprintln(w, htmlResult)130}

Full Screen

Full Screen

rendering.go

Source:rendering.go Github

copy

Full Screen

1// Package rendering provides a function to render HTML to images or HTML after JS execution.2// It uses the Chrome Debug Protocol through the rod package. It will download a headless3// Chrome version if needed that matches the current platform.4//5// If the environment variable SND_DEBUG=1 it will start the chrome instances6// in non-headless mode.7package rendering8import (9 "bytes"10 "errors"11 "image"12 _ "image/png"13 "net/url"14 "os"15 "github.com/go-rod/rod/lib/launcher"16 "github.com/go-rod/rod"17 "github.com/go-rod/rod/lib/proto"18)19var browser *rod.Browser20func init() {21 if os.Getenv("SND_DEBUG") == "1" {22 l := launcher.New().23 Headless(false).24 Devtools(true)25 browser = rod.New().ControlURL(l.MustLaunch()).MustConnect()26 } else {27 browser = rod.New().MustConnect()28 }29}30func screenshotPage(page *rod.Page, width int) (image.Image, error) {31 imageData, err := page.MustSetViewport(width, 10000, 1.0, false).MustElement("body").Screenshot(proto.PageCaptureScreenshotFormatPng, 100)32 if err != nil {33 return nil, err34 }35 img, _, err := image.Decode(bytes.NewBuffer(imageData))36 if err != nil {37 return nil, err38 }39 if img.Bounds().Max.Y >= 9500 {40 return nil, errors.New("too large")41 }42 return img, nil43}44// RenderHTML renders the element #content into an image.45func RenderHTML(html string, width int) (image.Image, error) {46 page := browser.MustPage("data:text/html," + url.PathEscape(html))47 page.MustWaitLoad().MustWaitIdle()48 defer page.Close()49 return screenshotPage(page, width)50}51// RenderURL opens the URL and renders the element #content into an image.52func RenderURL(url string, width int) (image.Image, error) {53 page := browser.MustPage(url)54 page.MustWaitLoad().MustWaitIdle()55 defer page.Close()56 return screenshotPage(page, width)57}58// ExtractHTML opens the URL, lets the page executes and returns the HTML.59func ExtractHTML(url string, selector string) (string, error) {60 page := browser.MustPage(url)61 page.MustWaitLoad().MustWaitIdle()62 defer page.Close()63 sel, err := page.Element(selector)64 if err != nil {65 return "", err66 }67 return sel.HTML()68}...

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 browser := rod.New().MustConnect()4 page := browser.MustPage("")5 page.MustWaitLoad()6 html := page.MustHTML()7 fmt.Println(html)8 title := page.MustTitle()9 fmt.Println(title)10 url := page.MustInfo().URL11 fmt.Println(url)12 cookies := page.MustCookies()13 fmt.Println(cookies)14 cookies2 := page.MustCookies()15 fmt.Println(cookies2)16 cookies3 := page.MustCookies()17 fmt.Println(cookies3)18 cookies4 := page.MustCookies()19 fmt.Println(cookies4)20 cookies5 := page.MustCookies()21 fmt.Println(cookies5)22 cookies6 := page.MustCookies()23 fmt.Println(cookies6)24 cookies7 := page.MustCookies()25 fmt.Println(cookies7)26 cookies8 := page.MustCookies()27 fmt.Println(cookies8)28 cookies9 := page.MustCookies()29 fmt.Println(cookies9)30 cookies10 := page.MustCookies()31 fmt.Println(cookies10)32 cookies11 := page.MustCookies()33 fmt.Println(cookies11)34 cookies12 := page.MustCookies()35 fmt.Println(cookies12)36 cookies13 := page.MustCookies()37 fmt.Println(cookies13)38 cookies14 := page.MustCookies()39 fmt.Println(cookies14)

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 browser := rod.New().MustConnect()4 page.MustElement("input[name=q]").MustInput("rod").MustPress("Enter")5 html := page.MustHTML(true)6 println(html)7}

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 fmt.Println(page.MustHTML())4}5page.MustHTML()6page.MustHTML()7page.MustHTML()8func (p *Page) HTML() (html string, err error) {9 return p.Eval(`document.documentElement.outerHTML`).String()10}11func (p *Page) MustHTML() (html string) {12 return p.MustEval(`document.documentElement.outerHTML`).String()13}14page.MustHTML()15page.MustHTML()

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1func (r *rod) HTML() string {2}3func (r *rod) SetHTML(html string) {4}5func (r *rod) Get() string {6}7func (r *rod) Set(html string) {8}9func (r *rod) HTML() string {10}11func (r *rod) SetHTML(html string) {12}13func (r *rod) Get() string {14}15func (r *rod) Set(html string) {16}17func (r *rod) HTML() string {18}19func (r *rod) SetHTML(html string) {20}21func (r *rod) Get() string {22}23func (r *rod) Set(html string) {24}25func (r *rod) HTML() string {26}27func (r *rod) SetHTML(html string) {28}29func (r *rod) Get() string {30}31func (r *rod) Set(html string) {32}33func (r *rod) HTML() string {34}35func (r *rod) SetHTML(html string) {36}

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 browser := rod.New().MustConnect()4 fmt.Println(page.MustElement("#hplogo").MustWaitVisible().MustHTML())5}6import (7func main() {8 browser := rod.New().MustConnect()9 fmt.Println(page.MustElement("#hplogo").MustWaitVisible().MustText())10}11import (12func main() {13 browser := rod.New().MustConnect()14 fmt.Println(page.MustElement("#hplogo").MustWaitVisible().MustHas("img"))15}16import (17func main() {18 browser := rod.New().MustConnect()19 fmt.Println(page.MustElement("#hplogo").MustWaitVisible().MustHasX("img"))20}21import (22func main() {23 browser := rod.New().MustConnect()

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1func main() {2 r := rod.New().MustConnect()3 defer r.MustClose()4 page.MustElement("#hplogo").MustWaitVisible().MustHTML()5}6func main() {7 r := rod.New().MustConnect()8 defer r.MustClose()9 page.MustElement("#hplogo").MustWaitVisible().MustHTML()10}11func main() {12 r := rod.New().MustConnect()13 defer r.MustClose()14 page.MustElement("#hplogo").MustWaitVisible().MustHTML()15}16func main() {17 r := rod.New().MustConnect()18 defer r.MustClose()19 page.MustElement("#hplogo").MustWaitVisible().MustHTML()20}21func main() {22 r := rod.New().MustConnect()23 defer r.MustClose()24 page.MustElement("#hplogo").MustWaitVisible().MustHTML()25}26func main() {27 r := rod.New().MustConnect()28 defer r.MustClose()29 page.MustElement("#hplogo").MustWaitVisible().MustHTML()30}31func main() {32 r := rod.New().MustConnect()33 defer r.MustClose()34 page.MustElement("#hplogo").MustWaitVisible().MustHTML()35}36func main() {37 r := rod.New().MustConnect()38 defer r.MustClose()

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1import (2type rod struct {3}4func (r rod) HTML() string {5 return fmt.Sprintf("<div style='color: %s;'>%d</div>", r.color, r.length)6}7func main() {8 r := rod{length: 10, color: "red"}9 fmt.Println(r.HTML())10}11import (12type rod struct {13}14func (r rod) HTML() string {15 return fmt.Sprintf("<div style='color: %s;'>%d</div>", r.color, r.length)16}17func main() {18 r := rod{length: 10, color: "red"}19 fmt.Println(r.HTML())20}21import (22type rod struct {23}24func (r rod) HTML() string {25 return fmt.Sprintf("<div style='color: %s;'>%d</div>", r.color, r.length)26}27func main() {28 r := rod{length: 10, color: "red"}29 fmt.Println(r.HTML())30}31import (32type rod struct {33}34func (r rod) HTML() string {35 return fmt.Sprintf("<div style='color: %s;'>%d</div>", r.color, r.length)36}37func main() {38 r := rod{length: 10, color: "red"}39 fmt.Println(r.HTML())40}41import (42type rod struct {43}44func (r rod) HTML() string {45 return fmt.Sprintf("<div style='color: %s;'>%d</div>", r.color, r.length)46}47func main() {48 r := rod{length: 10, color: "red"}49 fmt.Println(r.HTML())50}

Full Screen

Full Screen

HTML

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 s = html.EscapeString(s)4 fmt.Println(s)5}6import (7func main() {8 s = html.UnescapeString(s)9 fmt.Println(s)10}11import (12func main() {13 s = html.EscapeString(s)14 fmt.Println(s)15}16import (17func main() {18 s = html.UnescapeString(s)19 fmt.Println(s)20}21import (22func main() {23 s = html.EscapeString(s)24 fmt.Println(s)25}

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Rod automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful