bisguzar / twitter-scraper

Scrape the Twitter Frontend API without authentication.
MIT License
3.88k stars 600 forks source link

Is it possible to search for profile information using 'user_id' as input? #147

Open Cheryl520 opened 4 years ago

Cheryl520 commented 4 years ago

I noticed that to get profile information the only parameter is 'username'. I need to search for all the profile information of the users after i get a list of tweets. However, i think some users changed their username and no results were returned from twitter if I search based on 'username'. Therefore I'm thinking to search for profile using user_id.

Is it possible? Thanks very much!

ozanbayram commented 4 years ago

I am working on but I haven't achieved yet. "https://twitter.com/i/user/{USER-İD}" the url pattern is redirected "https://twitter.com/USERNAME" by using javascript or anything. I can't catch redirected url using html-requests Lib. I can use selenium to get redirected url. I aware that this is not convenience but i haven't found different way. What is your opinion @bisguzar

bisguzar commented 4 years ago

Same for me too, I worked about it on weekend. But using selenium or sth like it, is not a good idea for this library. Means to loot dependencies. Still lookin' for it.

bisguzar commented 4 years ago

By the way, one of our dependencies already has javascript support, please check out requests-html. But it uses pyppeteer for rendering javascript, pyppeteer depends chromium... Again and again, lot of and huge dependencies...

ozanbayram commented 4 years ago

I agree @bisguzar .Perhaps, It may be later found more convenient way. I wonder how this site 'https://tweeterid.com/' work.