1
How do i use BS4 and python? (ERROR)
AzureScripts (130)

I am trying to find a song title using genius

https://genius.com/search?q=Wrecking%20ball it grabs the "top result" and looks for the name by doing

soup.find('div', {"class": "mini_card-title"})
but it returns None?

You are viewing a single comment. View All
1
ash15khng (215)

You may need to replace the spaces in the title with %20.
Also, you should use an API for this, not scrape someone's website. You may get complaints if you use this a lot.

1
AzureScripts (130)

@ash15khng Nah it's fine uwu also, when you search normally with

search?q=Some Song Name, it brings you to the site anyway.

1
ash15khng (215)

@AzureScripts Oh I didn't know that. Anyways you could try soup.select().