Python 检索到的阿拉伯语推文中的单词顺序有问题

Python 检索到的阿拉伯语推文中的单词顺序有问题,python,twitter,arabic-support,Python,Twitter,Arabic Support,我从Tweepy那里提取阿拉伯语推文。这是密码 import tweepy import csv import pandas as pd import json ####input your credentials here consumer_key = '' consumer_secret = '' access_token = '' access_token_secret = '' auth = tweepy.OAuthHandler(consumer_key, consumer_sec

我从Tweepy那里提取阿拉伯语推文。这是密码

import tweepy
import csv
import pandas as pd
import json 
####input your credentials here
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth,wait_on_rate_limit=True)

# Open/Create a file to append data

csvFile = open('H1_1-10_extended_updated.csv', 'a', encoding='utf-8', newline=None)
#Use csv Writer
csvWriter = csv.writer(csvFile) 
for tweet in tweepy.Cursor(api.search,q="علم#" +" -filter:retweets",count=10000,
                           lang="ar",
                           tweet_mode= 'extended',
                           since="2020-10-1" , until="2020-10-2").items():
    print (tweet.created_at, tweet.full_text)
    csvWriter.writerow([{'id': tweet.id, 'created_at': tweet.created_at, 'text': tweet.full_text,  'source':  tweet.source, 'place': tweet.place, 'geo': tweet.geo, 'coordinates': tweet.coordinates, 'truncated': tweet.truncated, 'All user data': tweet.user, 'in_reply_to_status_id': tweet.in_reply_to_status_id,'in_reply_to_user_id': tweet.in_reply_to_user_id, ' in_reply_to_screen_name': tweet.in_reply_to_screen_name, 'retweet_count': tweet.retweet_count, 'favorite_count': tweet.favorite_count, 'favorited': tweet.favorited, 'retweeted': tweet.retweeted}])
问题在于检索到的推文的文本中的单词顺序,句子顺序不正确。我注意到只有当原始tweet带有多行时才会出现问题

这是检索到的tweet,文本中的单词顺序混乱:

以下是原始推文:

我想知道是否有人有主意。
谢谢

我怀疑这可能是由于阿拉伯语文本的显示方式,即
从右到左
格式,API可能无法处理此类情况。您可以考虑使用诸如“代码> BS4</代码>”这样的解析器来提取Web上出现的内容。