Skip to content

Commit 4682ac8

Browse files
committed
update
1 parent 31c3b3d commit 4682ac8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bard.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ func Bard() {
2626
page_bard.MustNavigate("https://bard.google.com")
2727

2828
for i := 1; i <= 30; i++ {
29-
if page_bard.MustHasX("//textarea[@id='mat-input-0']") {
29+
//if page_bard.MustHasX("//textarea[@id='mat-input-0']") {
30+
if page_bard.MustHasX("//rich-textarea[@aria-label='Input for prompt text']") {
3031
relogin_bard = false
3132
break
3233
}
@@ -58,7 +59,7 @@ func Bard() {
5859
select {
5960
case question := <-channel_bard:
6061
//page_bard.MustActivate()
61-
page_bard.MustElementX("//textarea[@id='mat-input-0']").MustWaitVisible().MustInput(question)
62+
page_bard.MustElementX("//rich-textarea[@aria-label='Input for prompt text']").MustWaitVisible().MustInput(question)
6263
page_bard.MustElementX("//button[@mattooltip='Submit']").MustClick()
6364
fmt.Println("Bard generating...")
6465
//page_bard.MustActivate()
@@ -76,7 +77,7 @@ func Bard() {
7677
}
7778
if generated_icon_appear == true {
7879
img := page_bard.MustElementX("//img[contains(@src, 'https://www.gstatic.com/lamda/images/sparkle_resting_v2_1ff6f6a71f2d298b1a31.gif')][last()]").MustWaitVisible()
79-
response := img.MustElementX("parent::div/parent::div").MustWaitVisible()
80+
response := img.MustElementX("parent::div/parent::bard-logo/parent::div/parent::div").MustWaitVisible()
8081
answer := response.MustText()
8182
channel_bard <- answer
8283
} else {

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
var trace = false
3434

35-
// var trace = true
35+
//var trace = true
3636
var userInput string
3737
var color_bard = tcell.ColorDarkCyan
3838
var color_bing = tcell.ColorDarkMagenta

0 commit comments

Comments
 (0)