简体   繁体   中英

WebScraping Table from Opensea

I am trying to scrape the data from the table on opensea.io/rankings. I can't seem to get data from every column. The output consists of 5 things per row, but the actual table has other stuff that somehow couldn't be scraped.

A sample output is:

Bored Ape Yacht Club
+ More
5,026.85
+14.15%
3

Would appreciate any help with this!

My code:

from selenium import webdriver
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import venue
import pandas as pd

PATH = ''
driver = webdriver.Chrome(PATH)

driver.get('https://opensea.io/rankings')

other_services = driver.find_element_by_xpath('/html/body/div[1]/div[1]/main/div/div[2]/div/div[2]')
#print(type(other_services))
print(other_services.text)
other_services = driver.find_element_by_xpath('/html/body/div[1]/div[1]/main/div/div[2]').get_attribute('outerHTML')
print(other_services)

worked for me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM