Last active
April 9, 2021 10:48
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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