Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 75edfc0

Browse files
add selenium
1 parent 02c7ac4 commit 75edfc0

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
test/
22
.vscode/
3-
.idea
3+
.idea
4+
geckodriver.log
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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)

‎findsth_open_in_broswer.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /