You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
About opening a goroutine to the page, resulting in an error: assignment to entry in nil map
, the scenario is: I want to have a thread to detect whether the page jumps to the robot sliding detection, and if there is detection, the sliding will be completed automatically, but why is this error reported, and what solutions can be used to deal with it.
Clone Rod to your local and cd to the repository:
git clone https://github.com/go-rod/rod
cd rod
Use your code to replace the content of function TestRod in file rod_test.go.
Test your code with: go test -run TestRod, make sure it fails as expected.
Replace ALL THE CONTENT under "The code to demonstrate your question" with your TestRod function, like below:
go PanduanYanZheng(page) !!!!!!!!!
//time.Sleep(time.Second*3)
go YanzhengmaShiBai(page) !!!!!!!!
//for i := 0; i < 3; i++ {
for i := 0; i < len(urlArray); i++ {
fmt.Println(urlArray[i])
wait := page.MustWaitNavigation() !!!!!!!!!!!!
page.MustNavigate(urlArray[i])
wait()
//完美
contactinfo,err := page.ElementX(`//li[@class="contactinfo"]/a`)
if err != nil {
fmt.Println("主线程有点小错误哦:",err)
}
//点击即将跳转新的页面
....................
## What you got
Such as what error you see.
## What you expected to see
Such as what you want to do.
## What have you tried to solve the question
Such as after modifying some source code of Rod you are able to get rid of the problem.
The text was updated successfully, but these errors were encountered:
Rod Version: v0.112.0
The code to demonstrate your question
About opening a goroutine to the page, resulting in an error: assignment to entry in nil map
, the scenario is: I want to have a thread to detect whether the page jumps to the robot sliding detection, and if there is detection, the sliding will be completed automatically, but why is this error reported, and what solutions can be used to deal with it.
Clone Rod to your local and cd to the repository:
git clone https://github.com/go-rod/rod cd rod
Use your code to replace the content of function
TestRod
in filerod_test.go
.Test your code with:
go test -run TestRod
, make sure it fails as expected.Replace ALL THE CONTENT under "The code to demonstrate your question" with your
TestRod
function, like below:``func HuoQu(page *rod.Page) {
urlArray := ExcelDuQu()
fmt.Println("数组的长度是:", len(urlArray))
var shangjia []ShangJia
....................
The text was updated successfully, but these errors were encountered: