evaneliasyoung / steam-py

A Python API for Steam userdata
GNU General Public License v3.0
4 stars 0 forks source link

get_avatar() takes the profile avatar frame instead of profile avatar #2

Open TgzFR opened 3 years ago

TgzFR commented 3 years ago

Here's my solution :

Line 213 :

    def get_avatar(self) -> str:
        """Will return the url of the avatar of the user."""
        for div in self.soup_main.find_all("div", {'class':'profile_avatar_frame'}):
            div.decompose()

        return str(self.soup_main.find('div', class_='playerAvatarAutoSizeInner').find('img')['src'])

I just added :

        for div in self.soup_main.find_all("div", {'class':'profile_avatar_frame'}):
            div.decompose()

This code removes the div where Steam Avatar Frame are stored.