Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Web Scraping Code Bug- Returning Empty List

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 25
    Answer it

    hi i want to scrap all the pairs that kucoin support from the webpage but the code that i wrote just return a empty list. how should i correct it?

    from bs4 import BeautifulSoup
    
    from selenium import webdriver
    
    driver = webdriver.Chrome(executable_path = r'C:\Users\Computer\Desktop\data\chromedriver.exe')
    
    driver.get('https://www.kucoin.com/markets?lang=en_US')
    
    results = []
    
    content = driver.page_source
    
    soup = BeautifulSoup(content)
    
    driver.quit()
    
    for element in soup.findAll(attrs = "tdHeadBox___2P8mW"):
    
      name = element.find('span')
    
      if name not in results:
    
        results.append(name.text)
    
    print(results)

     

    Thank you so much.

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: