OPENSEA批量上架NFT (二) 煩惱太多張圖片要上架? LISTING 大量NFT 教學 python幫你省時省力 Bulk NFT LISTING to OpenSea
繼上次批量上傳至opensea的分享後
OPENSEA批量上架NFT (一) => 幫你省時省力!批量上傳多張圖片到OPENSEA | python自動處裡大量圖片上傳...
你會發現上傳後省下一張一張上傳的時間
但還需要一次一次的反覆點上架才可以開始賣,耗時費力
既然可以批量自動上傳圖片 就應該也要能大量自動上架販售
這篇我們就是要來 接上她的腿
首先還是要先完成上篇文章的己的前置作業
詳細可以參考上一篇
STEP.1 匯出 Metamask
STEP.2 連接 Metamask
STEP.3 OPENSEA端部屬
到這個步驟專案資料夾下的分布會如下圖
接著我們會沿用connector下去擴充
接著我們會沿用connector下去擴充
文章裡程式碼排版可能會有折行導致運行失敗
建議用vs code開 裝個formater 去 format
建議用vs code開 裝個formater 去 format
擴充之後目錄會多出
opensea_bridge_metamask.py
opensea_list_helper.py
兩支檔案
其中幾處 collection/leghairtaiwan-love
是我的collection名稱 你要替換成你自己的
opensea__list_helper.py 程式碼:
import time
from selenium.webdriver.common.by import By
import metamask_connector
import opensea_bridge_metamask
metamask_connector.meta_mask_navigate()
opensea_bridge_metamask.connect()
time.sleep(5)
driver = metamask_connector.get_driver()
time.sleep(10)
print(driver.window_handles)
driver.switch_to.window(driver.window_handles[2])
time.sleep(1)
driver.execute_script('window.open("https://opensea.io/collection/leghairtaiwan-love","_self")')
print(driver.title)
for count in range(0, 100):
print('=======================')
print(str(count).zfill(3))
target_id = str(count).zfill(3)
target_script = 'window.open("https://opensea.io/collection/leghairtaiwan-love?search[query]=' + \
target_id + '"' + ',"_self")'
driver.execute_script(target_script)
time.sleep(3)
driver.find_elements(By.XPATH, "//article/a[contains(@href, 'assets/')]")[0].click()
time.sleep(3)
print(driver.current_url)
target_script = 'window.open("' + \
driver.current_url + '/sell"' + ',"_self")'
print(target_script)
driver.execute_script(target_script)
driver.find_element(By.XPATH, "//input[@name='price']").send_keys(0.006)
time.sleep(1)
driver.find_element(
By.XPATH, "//button[text()='Complete listing']").click()
# time.sleep(3)
# driver.find_element(By.XPATH, "//button[text()='Sign']").click()
time.sleep(10)
driver.switch_to.window(driver.window_handles[3])
print(driver.title)
time.sleep(5)
driver.find_element(By.XPATH, "//button[text()='簽署']").click()
time.sleep(5)
driver.switch_to.window(driver.window_handles[2])
print(driver.title)
print('=======================')
opensea_bridge_metamask.py 程式碼:
import time
from selenium.webdriver.common.by import By
import metamask_connector
def connect() :
driver = metamask_connector.get_driver()
driver.execute_script('window.open("https://opensea.io/login","_blank")')
time.sleep(1)
print(driver.window_handles)
driver.switch_to.window(driver.window_handles[2])
print(driver.title)
time.sleep(10)
driver.find_element(By.CLASS_NAME, "Navbar--brand").click()
time.sleep(1)
driver.back()
time.sleep(1)
driver.find_element(By.XPATH, "//span [text()='MetaMask']").click()
time.sleep(1)
print(driver.window_handles)
driver.switch_to.window(driver.window_handles[3])
time.sleep(3)
driver.find_element(By.CLASS_NAME, "btn-primary").click()
time.sleep(3)
driver.find_element(By.CLASS_NAME, "btn-primary").click()
運行後就開始自動上架囉:
常常有人提出的問題
是因為漏掉install插件那段
是因為漏掉install插件那段
如下運行pip補上就可以了
File "opensea_list_helper.py", line 2, in <module>
推薦文章:
EBISU'S BAY 介紹:
幣刷神卡CROYTO.COM 註冊教學:
幣安BINANCE教學:
MAX教學: