Skip to content

Instantly share code, notes, and snippets.

@passivebot
Last active April 9, 2021 10:48
Show Gist options
  • Select an option

  • Save passivebot/eaadd08c1a25d26d2a5334e53406731f to your computer and use it in GitHub Desktop.

Select an option

Save passivebot/eaadd08c1a25d26d2a5334e53406731f to your computer and use it in GitHub Desktop.
Function to extract username's of 1000 Elon Musk BitClout followers using bs4 and Selenium
# Required libraries
from bs4 import BeautifulSoup
from selenium import webdriver
def extractElonFollowers(browser: webdriver):
browser.get('https://bitclout.com/u/elonmusk/followers')
time.sleep(10)
source = browser.page_source
soup = BeautifulSoup(source)
for a in soup.find_all('a', href=True):
s = a['href']
# Python has a set of built-in methods that you can use on strings
s = s.replace('/u/','')
s= s.replace('/trade','')
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment