Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
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
backend
crawler
Commits
626b43f5
Commit
626b43f5
authored
Aug 17, 2021
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
aeb48597
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
38 deletions
+0
-38
test.py
dev/xinyang_ask_tag/test.py
+0
-38
No files found.
dev/xinyang_ask_tag/test.py
View file @
626b43f5
...
@@ -89,43 +89,5 @@ def get_cika_info_to_csv():
...
@@ -89,43 +89,5 @@ def get_cika_info_to_csv():
write_file
.
close
()
write_file
.
close
()
def
read_cika_info
():
all_cika_title
=
{}
cika_file
=
open
(
"soyoung_service_cika.csv"
,
"r"
,
encoding
=
"utf-8"
)
for
item
in
cika_file
.
readlines
():
cika
=
eval
(
item
)
for
key
,
values
in
cika
.
items
():
all_cika_title
[
key
]
=
values
print
(
all_cika_title
)
cika_file
.
close
()
return
all_cika_title
def
write_service_info_to_csv
():
all_cika_sub
=
[
'单次'
,
'2次'
,
'3次'
,
'4次'
,
'5次'
,
'6次'
,
'8次'
,
'9次'
,
'10次'
,
'20次'
'门市价'
]
read_file
=
open
(
"soyoung_service.csv"
,
"r"
,
encoding
=
"utf-8"
)
write_file
=
open
(
"soyoung_service_write_cika.csv"
,
"w"
,
encoding
=
"utf-8"
)
all_cika_title
=
read_cika_info
()
for
item
in
read_file
.
readlines
():
try
:
service_info
=
item
.
strip
()
.
split
(
","
)
print
(
"service_info"
,
service_info
)
service_id
=
service_info
[
2
]
cika_info
=
all_cika_title
.
get
(
service_id
)
if
cika_info
:
print
(
'cika_info:'
,
cika_info
)
for
cika
in
all_cika_sub
:
service_info
.
append
(
cika_info
.
get
(
cika
,
""
))
write_file
.
write
(
str
(
service_info
))
write_file
.
write
(
"
\n
"
)
except
Exception
as
e
:
print
(
"eeeeee:"
,
e
)
pass
read_file
.
close
()
write_file
.
close
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
get_cika_info_to_csv
()
get_cika_info_to_csv
()
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