Python: Read Twitter
import requests from bs4 import BeautifulSoup all_tweets = [] url = ' https://twitter.com/onnowpurbo' data = requests.get(url) html = BeautifulSoup(data.text, 'html.parser') timeline = html.select('#timeline li.stream-item') for tweet in timeline: tweet_id = tweet['data-item-id'] tweet_text = tweet.select('p.tweet-text')[0].get_text() all_tweets.append({"id": tweet_id, "text": tweet_text})
| Penerbit | Taratsa |
|---|---|
| Tahun | 2019-04-29 |
| Bahasa | ind |
| Pengenal | bookid: urn:uuid:54aa4967-c1dc-5e91-9f9a-eeaae4efe6a7 |