第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Go - 如何安裝 selenium 以在 Go 語言中使用它?

Go - 如何安裝 selenium 以在 Go 語言中使用它?

Go
明月笑刀無情 2021-07-16 18:15:44
我正在嘗試運行并測試此代碼,但缺少 selenium 并且我無法將其安裝在我的系統(tǒng)中,在這種情況下我該怎么辦?ERROR: while executetest.go:8:2: import "bitbucket.org/tebeka/selenium": cannot find packageINSTALL the package i tried:# apt-get install goisntallReading package lists... DoneBuilding dependency tree       Reading state information... DoneE: Unable to locate package goisntall# apt-cache search goinstallgolang-src - Go programming language compiler - source filesCODE: testing/* Selenium example goinstall bitbucket.org/tebeka/selenium */package yahooimport (  "strings"  "testing"  "bitbucket.org/tebeka/selenium")func TestYahoo(t *testing.T) {    /* We want firefox, don't care about version much */    caps := selenium.Capabilities {        "browserName": "firefox",    }    wd, _ := selenium.NewRemote(caps, "", "")    defer wd.Quit()    /* Navigate to Yahoo */    wd.Get("http://www.yahoo.com")    /* Fill the search box */    input, err := wd.FindElement(selenium.ByName, "p")    if err != nil {        t.Error(err.String())    }    err = input.SendKeys("golang")    if err != nil {        t.Error(err.String())    }    /* Hit the search button */    button, err := wd.FindElement(selenium.ById, "search-submit")    if err != nil {        t.Error(err.String())    }    err = button.Click()    if err != nil {        t.Error(err.String())    }    /* See that we get expected result */    source, err := wd.PageSource()    if err != nil {        t.Error(err.String())    }    if !strings.Contains(source, "The Go Programming Language") {        t.Error("Google can't find Go")    }}
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 448 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號