File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
1
test /
2
2
.vscode /
3
- .idea
3
+ .idea
4
+ geckodriver.log
Original file line number Diff line number Diff line change
1
+ # 安装selenium的chrome插件
2
+
3
+ 1 . [ 下载] ( https://sites.google.com/a/chromium.org/chromedriver/downloads )
4
+ 2 . 将下载地址配置到PATH
5
+
6
+ ## 网址
7
+ -[ 入门教程] ( https://testerhome.com/topics/18640 )
Original file line number Diff line number Diff line change
1
+ from selenium import webdriver
2
+
3
+ def open_in_chrome_incognito (url ):
4
+ chrome_options = webdriver .ChromeOptions ()
5
+ chrome_options .add_argument ("--incognito" )
6
+
7
+ driver = webdriver .Chrome (chrome_options = chrome_options )
8
+
9
+ driver .get (url )
10
+
11
+ def main ():
12
+ open_in_chrome_incognito ("https://www.baidu.com" )
13
+ open_in_chrome_incognito ("https://www.qq.com" )
14
+
15
+ if __name__ == '__main__' :
16
+ main ()
17
+
You can’t perform that action at this time.
0 commit comments