GithubHelp home page GithubHelp logo

Comments (5)

IsmAbd avatar IsmAbd commented on August 18, 2024 1

I got lucky with err = page.WaitElementsMoreThan("selector", 0).

from rod.

github-actions avatar github-actions commented on August 18, 2024

Please add a valid Rod Version: v0.0.0 to your issue. Current version is v0.114.8

generated by check-issue

from rod.

cplasfwst avatar cplasfwst commented on August 18, 2024

例如我的代码
//寻找评论按钮 page2.MustElementX(//div[@data-e2e="feed-comment-icon"]).MustClick() //.MustWaitLoad() //page2.MustWaitStable() //wait() //time.Sleep(time.Second * 3) //-----------先获取评论框,等待评论框出现后再获取评论条 //page2.MustElementX(//div[@Class="Gacm1K1M comment-header-inner-container"]) //fmt.Println("等待完成") //time.Sleep(time.Second * 5) //page2.MustElementX(//div[@data-e2e="comment-list"]`).MustWaitLoad()
//寻找评论列表里面的所有评论

	p2 := page2.MustElementX(`//div[@data-e2e="comment-list"]`).MustElementsX(`./div`)
	fmt.Println("一共加载了评论:", len(p2))`

Only delayed waiting will cause all 21 divs to appear, but I am not sure how long time.sleep will last.
If you use the method I commented out above, only one child element will appear. This is the cmd output:
Total comments loaded: 1
If you use time.sleep (2 seconds), you can fully load 21

from rod.

cplasfwst avatar cplasfwst commented on August 18, 2024

I got lucky with err = page.WaitElementsMoreThan("selector", 0).

I seem to have solved the above problem. Can I operate 2 pages at the same time?

from rod.

ysmood avatar ysmood commented on August 18, 2024

Can I operate 2 pages at the same time?

Yes

from rod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.