Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

uni-app 项目如何通过webview获得加载网页的html源代

index.vue 下创建webview窗口并加载网页方法如下
相关API Reference https://www.html5plus.org/doc/zh_cn/webview.html

                this.url = 'http://www.baidu.com';
                let styles = {
                        top: '0px',
                        width: '100%',    
                        zindex:0,
                        position: 'static',
                        titleNView: {
                            "autoBackButton": true,
                            "backgroundColor": '#202028',
                            "titleColor": '#ffffff',
                             
                        } ,
                        "hardwareAccelerated" : true, //开启硬件加速
                        "allowsInlineMediaPlayback": true,//ios关闭原生控件    
                                  
                };
                
                this.webview = plus.webview.create('','webview', styles, {}); 
                this.webview.loadURL(this.url)     
                this.webview.show(); 

我想获取这个 url 页面的html源码字符串数据,如何实现??


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.5k users

...