I'm building an application that lets a user input an Artists name on Soundcloud, and it will return a list of the Artist's followers.
- I can't figure out how to implement code that will return followers of a user input, unless I specify an artists' URL in a variable.
I'm using Selenium, lxml to parse text, and BeautifulSoup.
import bs4
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
import requests
import os
import time
browser = webdriver.Firefox(executable_path=r'/Users/trent/Desktop/Sound Scrape/geckodriver')
artist_url = "https://soundcloud.com/search/people?q="
follower_url = "https://soundcloud.com/user/followers"
while True:
name = input("Name of Artist: ")
"%20".join(name.split(" "))
request = requests.get(artist_url)
soup = bs4.BeautifulSoup(request.text, "lxml")
followers = soup.select("h2")
browser.get(artist_url + name + followers)
for f in followers:
print('%s: %s' % (f.text, f.get_attribute('h2')))
I'm getting confused, and thought I'd check out further than existing stack overflow posts, as I have not seen this unique problem. Any help would be greatly appreciated, Thank you!