Scrape Twitter Tweet Text with UBot

Twitter Logo Social Network

This UBot code quickly and easily scrapes 500 tweets from a Twitter search:

clear list(%tweets)
ui text box("Hashtag Search Term:",#searchTerm)
navigate("https://twitter.com/search?q=%23{#searchTerm}&src=typd","Wait")
wait for browser event("Everything Loaded","")
loop(50) {
run javascript("window.scrollTo(0,document.body.scrollHeight);")
wait(.5)
}
add list to list(%tweets,$scrape attribute(<class="TweetTextSize js-tweet-text tweet-text">,"innertext"),"Delete","Global")
wait(.5)
save to file("{$special folder("Application")}\\tweet-text-{#searchTerm}.txt",%tweets)
wait(.5)

 

This is done within the internal UBot browser without additional plugins.

 

Legal Issues can be raised by the use of web crawling and scraping tools. Twitter gives access to data analysts, but free access is limited. So you might need to pay a premium for unlimited access. If you scrape without the required permissions, it is illegal. Twitter Developers can use their API for obtaining information for apps, tools and market analysis https://dev.twitter.com/rest/public.

Be the first to comment

Leave a Reply

Your email address will not be published.


*