javascript - Selenium 中的 execute_script() 有什么作用
问题描述
browser.execute_script("window.open('about:blank', 'tab2');")
browser.switch_to.window("tab2")
browser.get('http://bing.com')
我正在网上搜索在 python 中使用 selenium 打开新标签页的方法,而ctrl + t的方法在 chrome 上不起作用,所以我偶然发现了上面的代码,但是我无法理解 'excute_script' 的作用。
解决方案
推荐阅读
- bash - 如何使用 bash 从字符串中提取所有 IP 地址
- css - 创建一个以弧形/上角滑动项目的滑块
- java - getParams() 与 JsonArrayRequest
- javascript - 为什么JS中的字符串替换不能替换所有字符
- r - 用于条件独立测试的 PC 算法中的“indepTest”错误
- jquery - 使用位置固定时的css问题
- dialogflow-es - 将对话流代理链接到 Google Cloud Console 项目并继承我分配给该项目的所有团队成员?
- python - IndexError:标量变量 NumPy 的索引无效
- sql - C3P0、rawConnectionOperation() 和 java.lang.IllegalArgumentException
- python - 32 位系统平台的时间戳超出范围