JustAnotherArchivist / snscrape

A social networking service scraper in Python
GNU General Public License v3.0
4.47k stars 708 forks source link

How can I scrape users Following Count? #262

Closed HAKANMAZI closed 3 years ago

HAKANMAZI commented 3 years ago

Hi @JustAnotherArchivist ,

With snscrape we can get the

But Why we can't scrape user.followingCount

HAKANMAZI commented 3 years ago

I found the answer.

class User(snscrape.base.Entity):
    # Most fields can be None if they're not known.

    username: str
    id: int
    displayname: typing.Optional[str] = None
    description: typing.Optional[str] = None # Description as it's displayed on the web interface with URLs replaced
    rawDescription: typing.Optional[str] = None # Raw description with the URL(s) intact
    descriptionUrls: typing.Optional[typing.List[DescriptionURL]] = None
    verified: typing.Optional[bool] = None
    created: typing.Optional[datetime.datetime] = None
    followersCount: typing.Optional[int] = None
    friendsCount: typing.Optional[int] = None
    statusesCount: typing.Optional[int] = None
    favouritesCount: typing.Optional[int] = None
    listedCount: typing.Optional[int] = None
    mediaCount: typing.Optional[int] = None
    location: typing.Optional[str] = None
    protected: typing.Optional[bool] = None
    linkUrl: typing.Optional[str] = None
    linkTcourl: typing.Optional[str] = None
    profileImageUrl: typing.Optional[str] = None
    profileBannerUrl: typing.Optional[str] = None