Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
inscription-trade-py
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
inscription-trade-py
Commits
1f951dbf
Commit
1f951dbf
authored
Jul 05, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
922a57b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
duneInscription.py
+19
-10
No files found.
duneInscription.py
View file @
1f951dbf
...
...
@@ -21,7 +21,8 @@ class Dune:
print
(
'元素不存在'
)
time
.
sleep
(
1
)
except
Exception
as
e
:
print
(
e
)
time
.
sleep
(
1
)
print
(
'元素不存在'
)
return
False
# 获取元素text
...
...
@@ -103,7 +104,9 @@ class Dune:
f
'//*[@id="__next"]/div/main/div[1]/div/section/div/div/article[16]/div/div[1]/table/tbody/tr[{j + 1}]/td[10]/div'
)
# Transactions(49,636)
obj
[
'Transactions'
]
=
self
.
getElementText
(
driver
,
f
'//*[@id="__next"]/div/main/div[1]/div/section/div/div/article[16]/div/div[1]/table/tbody/tr[{j + 1}]/td[11]/div'
)
print
(
obj
)
list
.
append
(
obj
)
if
len
(
list
)
>=
int
(
num
):
# 已爬完
...
...
@@ -126,21 +129,27 @@ class Dune:
options
=
webdriver
.
ChromeOptions
()
# options.add_argument('headless')
#
options
.
add_argument
(
'--no-sandbox'
)
options
.
add_argument
(
'--disable-dev-shm-usage'
)
options
.
add_argument
(
'--headless'
)
options
.
add_argument
(
"user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"
)
no_header
=
True
driver
=
None
if
no_header
:
# prod
options
.
add_argument
(
'--no-sandbox'
)
options
.
add_argument
(
'--disable-dev-shm-usage'
)
options
.
add_argument
(
'--headless'
)
options
.
add_argument
(
"user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"
)
options
.
add_argument
(
'window-size=1920x1080'
)
driver
=
webdriver
.
Chrome
(
options
=
options
)
options
.
add_argument
(
'window-size=1920x1080'
)
else
:
driver
=
webdriver
.
Chrome
()
driver
=
webdriver
.
Chrome
(
options
=
options
)
# 控制浏览器访问url地址
driver
.
get
(
"https://dune.com/tyler3/ethscription-indexer?undefined="
)
is_show
=
self
.
waitElement
(
driver
,
'//*[@id="__next"]/div/main/div[1]/div/section/div/div/article[16]/div/div[1]/table/tbody/tr[1]'
)
'//*[@id="__next"]/div/main/div[1]/div/section/div/div/article[16]/div/div[1]/table/tbody/tr[1]'
,
'xpath'
,
60
)
if
is_show
:
print
(
'元素已出现'
)
# 总行数
...
...
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