Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-reptile
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
network-assets-reptile
Commits
49ccfcd8
Commit
49ccfcd8
authored
Jul 25, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:ins爬虫数据条件过滤优化
parent
0d1ca3e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
createBrowserDriver.py
utils/createBrowserDriver.py
+17
-12
No files found.
utils/createBrowserDriver.py
View file @
49ccfcd8
...
@@ -101,17 +101,20 @@ def create(option=None, using_user_data=True, web_browser="firefox"):
...
@@ -101,17 +101,20 @@ def create(option=None, using_user_data=True, web_browser="firefox"):
if
platform
.
system
()
==
"Windows"
:
if
platform
.
system
()
==
"Windows"
:
binary_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"chrome_win64"
,
binary_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"chrome_win64"
,
"chrome.exe"
)
"chrome.exe"
)
webdriver_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"web-driver"
,
"chromedriver_win32"
,
webdriver_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"web-driver"
,
"chromedriver_win32"
,
"chromedriver.exe"
)
"chromedriver.exe"
)
elif
platform
.
system
()
==
"Linux"
:
elif
platform
.
system
()
==
"Linux"
:
binary_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
binary_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"chrome-linux64"
,
"chrome"
)
"chrome-linux64"
,
"chrome"
)
webdriver_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"web-driver"
,
"chromedriver_linux64"
,
webdriver_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"web-driver"
,
"chromedriver_linux64"
,
"chromedriver"
)
"chromedriver"
)
elif
platform
.
system
()
==
"Darwin"
:
elif
platform
.
system
()
==
"Darwin"
:
binary_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
binary_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"chrome-mac-x64"
,
"chrome.app"
)
"chrome-mac-x64"
,
"chrome.app"
)
webdriver_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"web-driver"
,
"chromedriver_mac64"
,
webdriver_location
=
os
.
path
.
join
(
os
.
path
.
abspath
(
"../"
),
'network-assets-reptile'
,
'browser'
,
"web-driver"
,
"chromedriver_mac64"
,
"chromedriver"
)
"chromedriver"
)
else
:
else
:
print
(
""
)
print
(
""
)
...
@@ -124,14 +127,16 @@ def create(option=None, using_user_data=True, web_browser="firefox"):
...
@@ -124,14 +127,16 @@ def create(option=None, using_user_data=True, web_browser="firefox"):
# service = ChromeService(executable_path=webdriver_location)
# service = ChromeService(executable_path=webdriver_location)
service
=
ChromeService
(
executable_path
=
webdriver_location
)
service
=
ChromeService
(
executable_path
=
webdriver_location
)
# service=service=ChromeService(ChromeDriverManager().install())
# service=service=ChromeService(ChromeDriverManager().install())
browser
=
webdriver
.
Chrome
(
options
=
options
,
service
=
service
)
browser
=
webdriver
.
Chrome
(
options
=
options
,
service
=
service
)
elif
web_browser
==
"edge"
:
elif
web_browser
==
"edge"
:
browser
=
webdriver
.
Edge
(
options
=
options
,
service
=
EdgeService
(
EdgeChromiumDriverManager
()
.
install
()))
browser
=
webdriver
.
Edge
(
options
=
options
,
service
=
EdgeService
(
EdgeChromiumDriverManager
()
.
install
()))
else
:
else
:
print
(
""
)
print
(
""
)
if
option
is
None
:
# 获取屏幕分辨率
# 获取屏幕分辨率
width
,
height
=
get_screen_resolution
()
width
,
height
=
get_screen_resolution
()
# 设置窗口大小为全屏
# 设置窗口大小为全屏
browser
.
set_window_size
(
width
,
height
)
browser
.
set_window_size
(
width
,
height
)
return
browser
return
browser
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment