twitter-scraper-selenium icon indicating copy to clipboard operation
twitter-scraper-selenium copied to clipboard

Install false

Open hoangthangbk51 opened this issue 2 years ago • 13 comments

image Please check . Some thinks wrong . Thanks for suppot

hoangthangbk51 avatar Jul 08 '22 06:07 hoangthangbk51

You're using Python 3.10?

shaikhsajid1111 avatar Jul 08 '22 06:07 shaikhsajid1111

You can clone this repository and try to install it from the source as well.

  1. Clone the repository
  2. Open Terminal in the repository directory
  3. Use the command pip install .

shaikhsajid1111 avatar Jul 08 '22 06:07 shaikhsajid1111

Ok thanks for support . I will try . And feedback. So what is vesion of python requirement ?

hoangthangbk51 avatar Jul 08 '22 08:07 hoangthangbk51

image

hoangthangbk51 avatar Jul 08 '22 12:07 hoangthangbk51

After install it show "name "ex" not defined ." Please check on picture

hoangthangbk51 avatar Jul 08 '22 12:07 hoangthangbk51

Can you please share what code you're using that causes this error?. I just tried and it is working fine for me but might be something which is happening at your side

shaikhsajid1111 avatar Jul 08 '22 12:07 shaikhsajid1111

from twitter_scraper_selenium import scrap_profile scrap_profile(twitter_username="LauraHa51649745",output_format="csv",browser="chrome",tweets_count=10,filename="microsoft",directory="home\use\downloads") this is my code .

hoangthangbk51 avatar Jul 08 '22 13:07 hoangthangbk51

You're probably hitting the authentication page here. I got it too few times, image

shaikhsajid1111 avatar Jul 08 '22 13:07 shaikhsajid1111

OK thanks . i got it . I have a question . i have a list of usenam id with txt file , and i would like to get the lastest tweet link and the lastest retweet link of all use on the list . Is posible ?

hoangthangbk51 avatar Jul 08 '22 13:07 hoangthangbk51

Yeah, it is possible

shaikhsajid1111 avatar Jul 08 '22 13:07 shaikhsajid1111

OH , I i happy to hear that. Can you give me some instruction

hoangthangbk51 avatar Jul 08 '22 13:07 hoangthangbk51

There are several ways I see,

  1. You can use twitter's API. But It often has a rate limit and is sometimes hard to deal with.
  2. You can use this library with the proxy of the country which might have loose internet laws. You're hitting auth wall frequently probably that's the reason. I tried the same username twice or thrice and it worked for me.
  3. You can even check this library https://github.com/JustAnotherArchivist/snscrape. Not sure if is still working but last year it was working though, it uses Twitter's API I assume.

If you're planning to create your own web crawler, you can't use simple HTTP requests to scrape because front-end code is injected via JavaScript. You must use a Web browser in an unofficial way but still, you'll have to deal with auth wall. Have a look at their API documentation, they've tweet id in their API response which they call the status field, you can just use that single field to generate a tweet's URL. Tweet's URL can be generated just by simple string concatenation https://twitter.com/{twitter_username}/status/{status} . I think they probably will have some similar mechanism for retweets as well. Your data for requirements are much simpler and can be resolved via API itself, if you need more data which is not present in their API then you should go with this library.

shaikhsajid1111 avatar Jul 08 '22 14:07 shaikhsajid1111

Thankyou so much. I will learn and try

hoangthangbk51 avatar Jul 09 '22 16:07 hoangthangbk51