Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web_scrapping
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiaying Cheng
web_scrapping
Commits
ba13cdb9
Commit
ba13cdb9
authored
9 months ago
by
Jiaying Cheng
Browse files
Options
Downloads
Patches
Plain Diff
update the changes
parent
2bc82abd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
basic/utils.py
+59
-3
59 additions, 3 deletions
basic/utils.py
output/charging_table.csv
+79
-0
79 additions, 0 deletions
output/charging_table.csv
output/information.csv
+519
-0
519 additions, 0 deletions
output/information.csv
with
657 additions
and
3 deletions
basic/utils.py
+
59
−
3
View file @
ba13cdb9
...
...
@@ -44,6 +44,58 @@ def read_href(file_name):
################# Get Cell Infomation in Table ############################
def
get_all_information
(
url
,
charging_file_name
,
information_file_name
):
driver
=
webdriver
.
Chrome
()
driver
.
get
(
url
)
model_name
=
url
.
split
(
'
/
'
)[
-
1
]
table_classes
=
[
'
charging-table-standard
'
,
'
charging-table-fast
'
]
for
table_class
in
table_classes
:
table
=
driver
.
find_element
(
by
=
By
.
CLASS_NAME
,
value
=
table_class
)
tablerows
=
table
.
find_elements
(
by
=
By
.
XPATH
,
value
=
"
.//tr
"
)
table_name
=
'
Home and Destination
'
if
table_class
==
'
charging-table-standard
'
else
'
Fast Charging
'
with
open
(
charging_file_name
,
mode
=
'
a
'
,
newline
=
""
,
encoding
=
"
utf-8
"
)
as
file
:
writer
=
csv
.
writer
(
file
)
writer
.
writerow
([
table_name
])
writer
.
writerow
([
'
Model_name
'
,
'
Charging Point
'
,
'
Max. Power
'
,
'
Power
'
,
'
Time Rate
'
])
for
tr
in
tablerows
:
cells
=
tr
.
find_elements
(
by
=
By
.
XPATH
,
value
=
"
.//td
"
)
row_data
=
[
model_name
]
+
[
cell
.
get_attribute
(
"
textContent
"
).
strip
()
for
cell
in
cells
]
writer
.
writerow
(
row_data
)
with
open
(
information_file_name
,
"
a
"
,
newline
=
""
,
encoding
=
"
utf-8
"
)
as
csvfile
:
writer
=
csv
.
writer
(
csvfile
)
writer
.
writerow
([
'
Model_name
''
Category
'
,
'
Attribute
'
,
'
Value
'
])
data_tables
=
driver
.
find_elements
(
by
=
By
.
CLASS_NAME
,
value
=
"
data-table
"
)
for
idx
,
data_table
in
enumerate
(
data_tables
):
try
:
category
=
data_table
.
find_element
(
by
=
By
.
XPATH
,
value
=
"
.//h2
"
)
category_text
=
category
.
get_attribute
(
"
textContent
"
).
strip
()
tables
=
data_table
.
find_elements
(
by
=
By
.
TAG_NAME
,
value
=
"
table
"
)
for
table
in
tables
:
rows
=
table
.
find_elements
(
by
=
By
.
XPATH
,
value
=
"
.//tr
"
)
for
tr
in
rows
:
cells
=
tr
.
find_elements
(
by
=
By
.
XPATH
,
value
=
"
.//td
"
)
if
len
(
cells
)
==
2
:
attribute
=
cells
[
0
]
attribute_text
=
attribute
.
get_attribute
(
"
textContent
"
).
strip
()
value
=
cells
[
1
]
value_text
=
value
.
get_attribute
(
"
textContent
"
).
strip
()
writer
.
writerow
([
model_name
,
category_text
,
attribute_text
,
value_text
])
except
:
print
(
"
There aren
'
t category
"
)
driver
.
quit
()
def
get_cell_in_charging_tables
(
url
,
file_name
):
"""
Get the cell contect in the table
'
Home and Destination Charging
'
and
...
...
@@ -112,10 +164,14 @@ href_list = read_href('..\output\href.txt')
# %%
charging_file
=
'
..\output\charging_table.csv
'
for
url
in
tqdm
(
href_list
[
20
:
30
]):
information_file
=
'
..\output\information.csv
'
# %%
for
url
in
tqdm
(
href_list
[
20
:
25
]):
get_cell_in_charging_tables
(
url
,
charging_file
)
# %%
information_file
=
'
..\output\information.csv
'
for
url
in
tqdm
(
href_list
[
15
:
20
]):
for
url
in
tqdm
(
href_list
[
20
:
25
]):
get_cell_in_data_table_save
(
url
,
information_file
)
# %%
# nach dem Meeting laufen lassen
for
url
in
tqdm
(
href_list
[
25
:
26
]):
get_all_information
(
url
,
charging_file
,
information_file
)
This diff is collapsed.
Click to expand it.
output/charging_table.csv
+
79
−
0
View file @
ba13cdb9
...
...
@@ -282,3 +282,82 @@ Model_name,Charging Point,Max. Power,Power,Time Rate
BYD-HAN,CCS (50 kW DC),50 kW,40 kW †,94 min,210 km/h
BYD-HAN,CCS (100 kW DC),100 kW,75 kW †,50 min,390 km/h
BYD-HAN,CCS (150 kW DC),120 kW †,85 kW †,44 min,450 km/h
Home and Destination
Model_name,Charging Point,Max. Power,Power,Time Rate
BYD-HAN
BYD-HAN
BYD-HAN,Wall Plug (2.3 kW),230V / 1x10A,2.3 kW,43h45m,11 km/h
BYD-HAN,1-phase 16A (3.7 kW),230V / 1x16A,3.7 kW,27h15m,17 km/h
BYD-HAN,1-phase 32A (7.4 kW),230V / 1x29A,6.6 kW †,15h15m,31 km/h
BYD-HAN,3-phase 16A (11 kW),230V / 1x16A,3.7 kW †,27h15m,17 km/h
BYD-HAN,3-phase 32A (22 kW),230V / 1x29A,6.6 kW †,15h15m,31 km/h
BYD-HAN
BYD-HAN,Wall Plug (2.3 kW),230V / 1x10A,2.3 kW,43h45m,11 km/h
BYD-HAN,1-phase 16A (3.7 kW),230V / 1x16A,3.7 kW,27h15m,17 km/h
BYD-HAN,1-phase 32A (7.4 kW),230V / 1x32A,7.4 kW,13h45m,35 km/h
BYD-HAN,3-phase 16A (11 kW),230V / 1x16A,3.7 kW †,27h15m,17 km/h
BYD-HAN,3-phase 32A (22 kW),230V / 1x32A,7.4 kW †,13h45m,35 km/h
Fast Charging
Model_name,Charging Point,Max. Power,Power,Time Rate
BYD-HAN
BYD-HAN,CCS (50 kW DC),50 kW,40 kW †,94 min,210 km/h
BYD-HAN,CCS (100 kW DC),100 kW,75 kW †,50 min,390 km/h
BYD-HAN,CCS (150 kW DC),120 kW †,85 kW †,44 min,450 km/h
Home and Destination
Model_name,Charging Point,Max. Power,Power,Time Rate
BYD-TANG
BYD-TANG,Wall Plug (2.3 kW),230V / 1x10A,2.3 kW,44h15m,8 km/h
BYD-TANG,1-phase 16A (3.7 kW),230V / 1x16A,3.7 kW,27h30m,13 km/h
BYD-TANG,1-phase 32A (7.4 kW),230V / 1x32A,7.4 kW,13h45m,26 km/h
BYD-TANG,3-phase 16A (11 kW),230V / 1x16A,3.7 kW †,27h30m,13 km/h
BYD-TANG,3-phase 32A (22 kW),230V / 1x32A,7.4 kW †,13h45m,26 km/h
Fast Charging
Model_name,Charging Point,Max. Power,Power,Time Rate
BYD-TANG
BYD-TANG,CCS (50 kW DC),50 kW,50 kW,76 min,190 km/h
BYD-TANG,CCS (150 kW DC),120 kW †,109 kW †,35 min,420 km/h
Home and Destination
Model_name,Charging Point,Max. Power,Power,Time Rate
Rolls-Royce-Spectre
Rolls-Royce-Spectre,Wall Plug (2.3 kW),230V / 1x10A,2.3 kW,52h15m,9 km/h
Rolls-Royce-Spectre,1-phase 16A (3.7 kW),230V / 1x16A,3.7 kW,32h30m,14 km/h
Rolls-Royce-Spectre,1-phase 32A (7.4 kW),230V / 1x32A,7.4 kW,16h15m,29 km/h
Rolls-Royce-Spectre,3-phase 16A (11 kW),400V / 3x16A,11 kW,11 hours,42 km/h
Rolls-Royce-Spectre,3-phase 32A (22 kW),400V / 3x32A,22 kW †,5h30m,85 km/h
Fast Charging
Model_name,Charging Point,Max. Power,Power,Time Rate
Rolls-Royce-Spectre
Rolls-Royce-Spectre,CCS (50 kW DC),50 kW,50 kW,90 min,210 km/h
Rolls-Royce-Spectre,CCS (100 kW DC),100 kW,85 kW †,53 min,360 km/h
Rolls-Royce-Spectre,CCS (150 kW DC),150 kW,105 kW †,43 min,450 km/h
Rolls-Royce-Spectre,CCS (175 kW DC),175 kW,115 kW †,39 min,500 km/h
Rolls-Royce-Spectre,CCS (350 kW DC),195 kW †,126 kW †,36 min,540 km/h
Home and Destination
Model_name,Charging Point,Max. Power,Power,Time Rate
BYD-SEAL-825-kWh-RWD-Design
BYD-SEAL-825-kWh-RWD-Design,Wall Plug (2.3 kW),230V / 1x10A,2.3 kW,42h15m,12 km/h
BYD-SEAL-825-kWh-RWD-Design,1-phase 16A (3.7 kW),230V / 1x16A,3.7 kW,26h15m,19 km/h
BYD-SEAL-825-kWh-RWD-Design,1-phase 32A (7.4 kW),230V / 1x32A,7.4 kW,13h15m,38 km/h
BYD-SEAL-825-kWh-RWD-Design,3-phase 16A (11 kW),400V / 3x16A,11 kW,9 hours,56 km/h
BYD-SEAL-825-kWh-RWD-Design,3-phase 32A (22 kW),400V / 3x16A,11 kW †,9 hours,56 km/h
Fast Charging
Model_name,Charging Point,Max. Power,Power,Time Rate
BYD-SEAL-825-kWh-RWD-Design
BYD-SEAL-825-kWh-RWD-Design,CCS (50 kW DC),50 kW,45 kW †,81 min,250 km/h
BYD-SEAL-825-kWh-RWD-Design,CCS (100 kW DC),100 kW,80 kW †,46 min,450 km/h
BYD-SEAL-825-kWh-RWD-Design,CCS (150 kW DC),150 kW,95 kW †,38 min,550 km/h
BYD-SEAL-825-kWh-RWD-Design,CCS (175 kW DC),150 kW †,95 kW †,38 min,550 km/h
BYD-SEAL-825-kWh-RWD-Design,CCS (350 kW DC),150 kW †,95 kW †,38 min,550 km/h
Home and Destination
Model_name,Charging Point,Max. Power,Power,Time Rate
Fiat-500e-Hatchback-42-kWh
Fiat-500e-Hatchback-42-kWh,Wall Plug (2.3 kW),230V / 1x10A,2.3 kW,19h15m,12 km/h
Fiat-500e-Hatchback-42-kWh,1-phase 16A (3.7 kW),230V / 1x16A,3.7 kW,12 hours,20 km/h
Fiat-500e-Hatchback-42-kWh,1-phase 32A (7.4 kW),230V / 1x32A,7.4 kW,6 hours,39 km/h
Fiat-500e-Hatchback-42-kWh,3-phase 16A (11 kW),400V / 3x16A,11 kW,4 hours,59 km/h
Fiat-500e-Hatchback-42-kWh,3-phase 32A (22 kW),400V / 3x16A,11 kW †,4 hours,59 km/h
Fast Charging
Model_name,Charging Point,Max. Power,Power,Time Rate
Fiat-500e-Hatchback-42-kWh
Fiat-500e-Hatchback-42-kWh,CCS (50 kW DC),49 kW †,49 kW †,34 min,290 km/h
Fiat-500e-Hatchback-42-kWh,CCS (150 kW DC),85 kW †,67 kW †,25 min,390 km/h
This diff is collapsed.
Click to expand it.
output/information.csv
+
519
−
0
View file @
ba13cdb9
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment