Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
chip1stop_cate
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a3380642
authored
Apr 02, 2019
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
u
parent
0e595790
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
2 deletions
goods.py
goods.py
View file @
a3380642
...
...
@@ -13,7 +13,6 @@ from chip1stop.rabbit_conn import producer
chrome_options
=
webdriver
.
ChromeOptions
()
chrome_options
.
add_argument
(
'blink-settings=imagesEnabled=false'
)
# chrome_options.add_argument('--headless')
chrome_options
.
add_argument
(
'--disable-gpu'
)
chrome_options
.
add_argument
(
'--disable-images'
)
...
...
@@ -23,7 +22,7 @@ pid_driver_map = dict()
logger
=
Mylogger
(
'error.log'
)
.
logger
dcap
=
dict
(
DesiredCapabilities
.
PHANTOMJS
)
dcap
[
"phantomjs.page.settings.userAgent"
]
=
(
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0"
)
#设置user-agent请求头
dcap
[
"phantomjs.page.settings.loadImages"
]
=
False
#禁止加载图片
dcap
[
"phantomjs.page.settings.loadImages"
]
=
False
def
gen_table_doms
(
url
,
cat_id
):
pid
=
os
.
getpid
()
if
pid
in
pid_driver_map
:
...
...
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