GithubHelp home page GithubHelp logo

测试时如何获取当前网页 about rod HOT 5 CLOSED

pqj325 avatar pqj325 commented on July 2, 2024
测试时如何获取当前网页

from rod.

Comments (5)

github-actions avatar github-actions commented on July 2, 2024

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

generated by check-issue

from rod.

ysmood avatar ysmood commented on July 2, 2024

什么意思?

from rod.

pqj325 avatar pqj325 commented on July 2, 2024

场景是这样:手工打开一个网页,希望写一段代码实现获取当前网页,并执行代码种的操作,比如点击等。
https://go-rod.github.io/i18n/zh-CN/#/custom-launch?id=%e8%bf%9e%e6%8e%a5%e5%88%b0%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84%e6%b5%8f%e8%a7%88%e5%99%a8
这里的案例中,需要配置MustPage参数,能否不需要配置这个url就能执行代码,从而获取到当前网页?


import (
    "github.com/go-rod/rod"
)

func main() {
    u := "ws://127.0.0.1:9222/devtools/browser/4dcf09f2-ba2b-463a-8ff5-90d27c6cc913"
    rod.New().ControlURL(u).MustConnect().MustPage("https://example.com")
}```

from rod.

ysmood avatar ysmood commented on July 2, 2024

我不懂

from rod.

pqj325 avatar pqj325 commented on July 2, 2024

好吧,我先看看文档

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.