twitter

Tweets scraping using Python selinum

Tweets scraping using Python selinum Question: I am trying to scrape tweets under a hashtag using Python selinum and I use the following code to scroll down driver.execute_script(‘window.scrollTo(0,document.body.scrollHeight);’) The problem is that selinum only scrapes shown tweets (only 3 tweets) and then scroll down to the end of the page and load more tweets and …

Total answers: 2

Find all hashtags

Find all hashtags Question: I have a class Tweet that contains several tweets. Then there’s a list that contains all the tweets. These tweets also have users, amount of retweets and age, which is not relevant to my question. Only content matters. tweet1 = Tweet("@realDonaldTrump", "Despite the negative press covfefe #bigsmart", 1249, 54303) tweet2 = …

Total answers: 1

Retrieve viral tweets topic from Twitter API

Retrieve viral tweets topic from Twitter API Question: I’m trying to retrieve viral tweets for an academic project using the Twitter API v2. There is a Topic on Twitter called "viral tweets" which is perfect for what I want. It has id 1284234742661963776 so my thoughts was to query using context annotations. However there is …

Total answers: 1

Scrape Data from Twitter using Snscrape, return error with Tweet object has no attribute 'likeCount'

Scrape Data from Twitter using Snscrape, return error with Tweet object has no attribute 'likeCount' Question: Follow the code import snscrape.modules.twitter as sntwitter import pandas as pd # Creating list to append tweet data to attributes_container = [] # Using TwitterSearchScraper to scrape data and append tweets to list for i,tweet in enumerate(sntwitter.TwitterSearchScraper(‘sex for grades …

Total answers: 1

Twitter bot using tweepy failed to tweet

Twitter bot using tweepy failed to tweet Question: I do not speak English well. So I am using a translator. Please understand. I’m making a twitter bot that automatically tweets via tweepy. I succeeded in connecting the Twitter app, but it doesn’t tweet. please help me I need your help. This is the code I …

Total answers: 1

Python Twitter bot, Tweepy 4.10.1 gives Traceback error and tweepy.errors.Forbidden 403

Python Twitter bot, Tweepy 4.10.1 gives Traceback error and tweepy.errors.Forbidden 403 Question: I made sure that all the keys and secrets are correct, but I’m just not sure that I’m getting it. (I HAVE ELEVATED ACCESS) I was following this tutorial on YouTube. This is the Python code: import tweepy api_key = "XXXXX" api_secret = …

Total answers: 2

using try-except block to scrape data from twitter api

using try-except block to scrape data from twitter api Question: I’m scraping data from twiter with using their tweet ids but some of the tweets have been deleted so my code throws an error when it gets to those tweets ids how do I use "try-except" to just skip those tweet ids or populate the …

Total answers: 1

How to decompose twitter hashtags into words?

How to decompose twitter hashtags into words? Question: I’m trying to decompose twitter hashtags in order to extract the words that compose it. I’m having trouble finding a regular expression that can do this satisfactorily, mainly due to the authors’ "excessive creativity" in capitalization. Some examples: #itsAHashtag -> [‘its’, ‘a’, ‘hashtag’] #GlazersOutNOW -> [‘glazers’, ‘out’, …

Total answers: 2

get_user() takes 1 positional argument but 2 were given

get_user() takes 1 positional argument but 2 were given Question: I’ve been having issues getting passed this bug, I was wondering If anyone could help. Or could point me in the right direction? I believe the issue may be with API.get_user. But I just cannot find a workaround it. This script is supposed to read …

Total answers: 1

Extract full tweet Tweepy Python

Extract full tweet Tweepy Python Question: I can’t find a way to get the full text of a tweet, I have everything activated, tweet_mode="extended" and I print tweet.full_text, but it keeps getting the trimmed tweet, I’ve looked directly at tweet._json and it’s also trimmed there I don’t understand why import tweepy import configparser from datetime …

Total answers: 1