In [1]:
import requests
import json
from bs4 import BeautifulSoup
import re

In [2]:
quora_url = 'https://www.quora.com/'

In [6]:
r = requests.get(quora_url+'topic/china')
r.status_code


Out[6]:
200

In [19]:
soup = BeautifulSoup(r.content,'lxml')
topic_json = {}

In [9]:
feed_questions = []
for a in soup.find_all('a',attrs={'class':'question_link'}):
    feed_questions.append({'question_link':a['href'],'question_text':a.text})
    #questions.extend(re.findall('[0-9]{1}([^\?0-9]+\?)',p.get_text(),re.M))

In [20]:
topic_json['feed_questions'] = feed_questions

In [22]:
topic_json['TopicWikiText'] = soup.find_all('div',attrs={'class':'TopicWikiText'})[0].text

In [24]:
Questions = soup.find_all('a',attrs={'class':'StatsRow TopicQuestionsStatsRow'})[0]
topic_json['Questions_link'] = Questions['href']
topic_json['Questions_text'] = Questions.text

In [26]:
Followers = soup.find_all('a',attrs={'class':'TopicFollowersStatsRow StatsRow'})[0]
topic_json['Followers_link'] = Followers['href']
topic_json['Followers_text'] = Followers.text

In [27]:
Edits = soup.find_all('a',attrs={'class':'TopicEditsStatsRow StatsRow'})[0]
topic_json['Edits_link'] = Edits['href']
topic_json['Edits_text'] = Edits.text

In [31]:
related_topics = []#RelatedTopicsListItem HoverMenu
for a in soup.find_all('a',attrs={'class':'RelatedTopicsListItem HoverMenu'}):
    related_topics.append({'topic_link':a['href'],'TopicName':a.find_all('span',attrs={'class':'TopicName'})[0].text})
topic_json['related_topics'] = related_topics

In [126]:
class Topic(object):
    def __init__(self,topic_name):
        self.topic_name = topic_name
        self.url = 'https://www.quora.com/topic/'+self.topic_name
        self.res = requests.get(self.url)
        if self.res.status_code == 200:
            self.soup = BeautifulSoup(self.res.content,'lxml')   
        self.feed_questions = []
        self.Questions = {}
        self.Followers = {}
        self.Edits = {}
        self.related_topics = []
        for a in self.soup.find_all('a',attrs={'class':'question_link'}):
            self.feed_questions.append({'question_link':a['href'],'question_text':a.text})
        Questions_soup = self.soup.find_all('a',attrs={'class':'StatsRow TopicQuestionsStatsRow'})[0]
        self.Questions['Questions_link'] = Questions_soup['href']
        self.Questions['Questions_text'] = Questions_soup.text
        Followers_soup = self.soup.find_all('a',attrs={'class':'StatsRow TopicQuestionsStatsRow'})[0]
        self.Followers['Followers_link'] = Followers_soup['href']
        self.Followers['Followers_text'] = Followers_soup.text
        Edits_soup = self.soup.find_all('a',attrs={'class':'StatsRow TopicQuestionsStatsRow'})[0]
        self.Edits['Edits_link'] = Edits_soup['href']
        self.Edits['Edits_text'] = Edits_soup.text
        for a in self.soup.find_all('a',attrs={'class':'RelatedTopicsListItem HoverMenu'}):
            self.related_topics.append({'topic_link':a['href'],'TopicName':a.find_all('span',attrs={'class':'TopicName'})[0].text})
        self.topic_json = {}
        
    def get_topic_json(self):
        self.topic_json['topic_name'] = self.topic_name
        self.topic_json['topic_url'] = self.url
        self.topic_json['feed_questions'] = self.feed_questions
        self.topic_json['TopicWikiText'] = self.soup.find_all('div',attrs={'class':'TopicWikiText'})[0].text
        self.topic_json['Questions'] = self.Questions
        self.topic_json['Followers'] = self.Followers
        self.topic_json['Edits'] = self.Edits
        self.topic_json['related_topics'] = self.related_topics
        return self.topic_json

In [106]:
china = Topic('china')

In [107]:
j = china.get_topic_json()

In [108]:
china.get_topic_json()


Out[108]:
{'Edits': {'Edits_link': '/topic/China/all_questions',
  'Edits_text': u'78.4kQuestions'},
 'Followers': {'Followers_link': '/topic/China/all_questions',
  'Followers_text': u'78.4kQuestions'},
 'Questions': {'Questions_link': '/topic/China/all_questions',
  'Questions_text': u'78.4kQuestions'},
 'TopicWikiText': u"Topic mainly concerns the East Asian state the People's Republic of China.For the Republic of China see Taiwan",
 'feed_questions': [{'question_link': '/How-safe-is-China',
   'question_text': u'How safe is China?'},
  {'question_link': '/How-do-foreigners-view-China-after-visiting-China',
   'question_text': u'How do foreigners view China after visiting China?'},
  {'question_link': '/Why-do-the-Chinese-still-care-about-the-Nanjing-massacre-so-much',
   'question_text': u'Why do the Chinese still care about the Nanjing massacre so much?'},
  {'question_link': '/Why-is-China-still-so-hateful-and-rude-to-current-Japan-when-they-had-no-part-in-the-militarys-past',
   'question_text': u"Why is China still so hateful and rude to current Japan when they had no part in the military's past?"},
  {'question_link': '/After-years-of-learning-why-are-most-Chinese-people-still-not-good-at-speaking-English',
   'question_text': u'After years of learning, why are most Chinese people still not good at speaking English?'},
  {'question_link': '/Should-China-get-out-of-Tibet-like-UK-got-out-of-Hong-Kong',
   'question_text': u'Should China get out of Tibet like UK got out of Hong Kong?'},
  {'question_link': '/Why-do-educated-Chinese-support-CCP-despite-not-having-the-freedom-to-criticize-Chinese-politicians',
   'question_text': u'Why do educated Chinese support CCP despite not having the freedom to criticize Chinese politicians?'},
  {'question_link': '/How-do-foreigners-view-China-after-visiting-China',
   'question_text': u'How do foreigners view China after visiting China?'},
  {'question_link': u'/What-does-\u6211\u53bb-mean-in-Chinese',
   'question_text': u'What does "\u6211\u53bb" mean in Chinese?'},
  {'question_link': '/What-does-it-feel-like-to-be-a-woman-living-in-China',
   'question_text': u'What does it feel like to be a woman living in China?'},
  {'question_link': '/How-do-foreigners-view-China-after-visiting-China',
   'question_text': u'How do foreigners view China after visiting China?'},
  {'question_link': '/What-do-non-Chinese-Japanese-people-think-of-the-Nanjing-Massacre-2',
   'question_text': u'What do non-Chinese/Japanese people think of the Nanjing Massacre?'},
  {'question_link': '/What-do-non-Chinese-Japanese-people-think-of-the-Nanjing-Massacre?no_redirect=1',
   'question_text': u'What do non Chinese / Japanese people think of the Nanjing Massacre ?'},
  {'question_link': '/Why-is-it-that-people-are-saying-China-is-a-good-place-to-live-in-Millions-of-people-have-been-migrating-from-China-to-other-countries',
   'question_text': u'Why is it that people are saying China is a good place to live in? Millions of people have been migrating from China to other countries.'},
  {'question_link': '/Is-Chinese-a-beautiful-language',
   'question_text': u'Is Chinese a beautiful language?'},
  {'question_link': '/What-country-is-culturally-closest-to-China',
   'question_text': u'What country is culturally closest to China?'},
  {'question_link': '/Is-there-persecution-of-Muslims-in-China',
   'question_text': u'Is there persecution of Muslims in China?'},
  {'question_link': '/Why-dont-Chinese-people-attack-the-PLA-with-all-their-might-and-liberate-themselves',
   'question_text': u"Why don't Chinese people attack the PLA with all their might and liberate themselves?"},
  {'question_link': '/What-makes-the-Chinese-government-a-bad-government',
   'question_text': u'What makes the Chinese government a bad government?'},
  {'question_link': '/Why-do-so-many-foreigners-go-to-China-and-think-China-is-good',
   'question_text': u'Why do so many foreigners go to China and think China is good?'},
  {'question_link': '/How-do-foreigners-view-China-after-visiting-China',
   'question_text': u'How do foreigners view China after visiting China?'}],
 'related_topics': [{'TopicName': u'Foreign Policy of China',
   'topic_link': '/topic/Foreign-Policy-of-China'},
  {'TopicName': u'Chinese Ethnicity and People',
   'topic_link': '/topic/Chinese-Ethnicity-and-People-1'},
  {'TopicName': u'India-China Relations',
   'topic_link': '/topic/India-China-Relations-1'},
  {'TopicName': u'Culture of China',
   'topic_link': '/topic/Culture-of-China-1'},
  {'TopicName': u'US - China Relations',
   'topic_link': '/topic/US-China-Relations-2'},
  {'TopicName': u'International Relations',
   'topic_link': '/topic/International-Relations-3'},
  {'TopicName': u'Politics of China',
   'topic_link': '/topic/Politics-of-China'},
  {'TopicName': u'History of China', 'topic_link': '/topic/History-of-China'},
  {'TopicName': u'The Economy of China',
   'topic_link': '/topic/The-Economy-of-China'},
  {'TopicName': u'China and Hong Kong',
   'topic_link': '/topic/China-and-Hong-Kong'},
  {'TopicName': u'Hong Kong', 'topic_link': '/topic/Hong-Kong'},
  {'TopicName': u'Chinese (language)',
   'topic_link': '/topic/Chinese-language'},
  {'TopicName': u'Taiwan', 'topic_link': '/topic/Taiwan'},
  {'TopicName': u'China and Japan', 'topic_link': '/topic/China-and-Japan-1'},
  {'TopicName': u'Cross-Strait Relations (China and Taiwan)',
   'topic_link': '/topic/Cross-Strait-Relations-China-and-Taiwan'}],
 'topic_name': 'china',
 'topic_url': 'https://www.quora.com/topic/china'}

In [144]:
class Question(object):
    def __init__(self,questoin_name):
        self.questoin_name = questoin_name
        self.url = 'https://www.quora.com/'+self.questoin_name
        self.res = requests.get(self.url)
        if self.res.status_code == 200:
            self.soup = BeautifulSoup(self.res.content,'lxml')
        self.QuestionTopic = []
        for a in self.soup.find_all('a',attrs={'class':'TopicNameLink HoverMenu topic_name'}):
            self.QuestionTopic.append({'topic_link':a['href'],'TopicName':a.text})
        self.answer_count = int(re.findall('[0-9]+',self.soup.find_all('div',attrs={'class':'answer_count'})[0].text)[0])
        self.answer = []
        for d1 in self.soup.find_all('div',attrs={'class':'AnswerBase'}):
            for d2 in d1.find_all('div',attrs={'class':'AnswerHeader ContentHeader'}):
                user = {}
                for a in d2.find_all('a',attrs={'class':'user'}):
                    user['user_link'] = a['href']
                    user['UserName'] = a.text
            self.answer.append({'user':user,'answer_text':d1.find_all('span',attrs={'class':'rendered_qtext'})[0].text})
        self.question_json = {}
        
    def get_question_json(self):
        self.question_json['questoin_name'] = self.questoin_name
        self.question_json['url'] = self.url
        self.question_json['QuestionTopic'] = self.QuestionTopic
        self.question_json['answer_count'] = self.answer_count
        self.question_json['answer'] = self.answer
        return self.question_json

In [69]:
res = requests.get('https://www.quora.com/How-do-mongolians-treat-foreigners')

In [70]:
q_soup = BeautifulSoup(res.content,'lxml')

In [71]:
for a in q_soup.find_all('a',attrs={'class':'TopicNameLink HoverMenu topic_name'}):
    print a


<a action_mousedown="TopicLinkClickthrough" class="TopicNameLink HoverMenu topic_name" href="/topic/Mongolian-Ethnicity-and-People" id="__w2_wrzlw0I_link" target=""><span class="name_text"><span id="CwXyHY"><span class="TopicNameSpan TopicName" id="__w2_DDEHbmc_card">Mongolian Ethnicity and People</span></span></span></a>
<a action_mousedown="TopicLinkClickthrough" class="TopicNameLink HoverMenu topic_name" href="/topic/Mongolia" id="__w2_XOvZkfu_link" target=""><span class="name_text"><span id="Swupoo"><span class="TopicNameSpan TopicName" id="__w2_f2lQpgy_card">Mongolia</span></span></span></a>
<a action_mousedown="TopicLinkClickthrough" class="TopicNameLink HoverMenu topic_name" href="/topic/Foreigners" id="__w2_QBEYCFM_link" target=""><span class="name_text"><span id="JalypP"><span class="TopicNameSpan TopicName" id="__w2_Co3shmF_card">Foreigners</span></span></span></a>
<a action_mousedown="TopicLinkClickthrough" class="TopicNameLink HoverMenu topic_name" href="/topic/Ethnic-and-Cultural-Differences-1" id="__w2_vjULiMj_link" target=""><span class="name_text"><span id="aHPwSy"><span class="TopicNameSpan TopicName" id="__w2_Rkr0yJV_card">Ethnic and Cultural Differences</span></span></span></a>

In [102]:
# pagedlist_item AnswerBase AnswerHeader ContentHeader feed_item_answer_user Answer
answer = []
for d1 in q_soup.find_all('div',attrs={'class':'AnswerBase'}):
    for d2 in d1.find_all('div',attrs={'class':'AnswerHeader ContentHeader'}):
        user = {}
        for a in d2.find_all('a',attrs={'class':'user'}):
            user['user_link'] = a['href']
            user['UserName'] = a.text
    answer.append({'user':user,'answer_text':d1.find_all('span',attrs={'class':'rendered_qtext'})[0].text})

In [103]:
answer


Out[103]:
[{'answer_text': u"mongols are highly hospitable people. for us, guest is above everything else. this is especially true in countryside. when somebody comes to your house, the usual reaction is to feed the person and give tea. and afterwards ask what that person is doing there etc. sleeping in the house is common.mongolia is generally safe country for foreigners as well.there are couple of taboos that i wrote previously. have alook:Anandsaikhan Nyamdavaa's answer to What are the biggest mistakes people make when visiting Mongolia?",
  'user': {'UserName': u'Anandsaikhan Nyamdavaa',
   'user_link': '/profile/Anandsaikhan-Nyamdavaa'}},
 {'answer_text': u'If you\u2019re generalizing,Some of us can be a little too rude to foreigners. On the other hand, some of us treat foreigners as a sack of cash and charge extra for any services. Some of us, who are just as innocent and friendly as Mongolians are known for, look favorably upon foreigners and are happy to see many foreigners choosing our country to visit.I can\u2019t honestly tell you one specific way we treat foreigners.',
  'user': {'UserName': u'Binderya Usukhbayar',
   'user_link': '/profile/Binderya-Usukhbayar'}}]

In [114]:
int(q_soup.find_all('div',attrs={'class':'answer_count'})[0].text.split(' ')[0])


Out[114]:
2

In [124]:
q = Question('Do-Chinese-and-Japanese-have-similarities')

In [125]:
q.get_question_json()


Out[125]:
{'QuestionTopic': [{'TopicName': u'China and Japan',
   'topic_link': '/topic/China-and-Japan-1'},
  {'TopicName': u'Japanese Ethnicity and People',
   'topic_link': '/topic/Japanese-Ethnicity-and-People'},
  {'TopicName': u'Japanese (language)',
   'topic_link': '/topic/Japanese-language'},
  {'TopicName': u'Chinese (language)',
   'topic_link': '/topic/Chinese-language'},
  {'TopicName': u'Chinese Ethnicity and People',
   'topic_link': '/topic/Chinese-Ethnicity-and-People-1'},
  {'TopicName': u'Japan', 'topic_link': '/topic/Japan'},
  {'TopicName': u'China', 'topic_link': '/topic/China'}],
 'answer': [{'answer_text': u'They have, both culturally and in their languages. Some are almost the same, some are similar and others are completely different. Still, what you want to know specifically? There\u2019s a lot of variable to nations and their people.',
   'user': {'UserName': u'Rodrigo Xavier',
    'user_link': '/profile/Rodrigo-Xavier-1'}},
  {'answer_text': u'Yes, there are a lot of similarities. Below I list a few of them. You can find many more.Family value. Both Chinese and Japanese tend to keep a close relationship with their parents even after they become adults.Investment on education. Both Chinese and Japanese think education are of great importance, and are willing to invest a lot on their children\u2019s education.Pressure from exams. Both Chinese students and Japanese students have too much pressure from exams, especially from college entrance exams.Expression of opinions. Neither Chinese nor Japanese are willing to express their opinions in the most direct way (i.e., in the American way). They always make it subtle and implicit.',
   'user': {'UserName': u'Sheng Zhong',
    'user_link': '/profile/Sheng-Zhong-17'}},
  {'answer_text': u'Yeah.Both are human. Both come from Asia.Both share a lot of characters in their languages. Sometimes with different meanings, and usually with different pronunciation.',
   'user': {'UserName': u'Gus Martin', 'user_link': '/profile/Gus-Martin-2'}},
  {'answer_text': u'would You be Specifically thinking of the languages,or cultures?',
   'user': {'UserName': u'Yuki-Jennifer Aleksandra Asuka Kurumi',
    'user_link': '/profile/Yuki-Jennifer-Aleksandra-Asuka-Kurumi'}}],
 'answer_count': 4,
 'questoin_name': 'Do-Chinese-and-Japanese-have-similarities',
 'url': 'https://www.quora.com/Do-Chinese-and-Japanese-have-similarities'}

In [128]:
china_topic = Topic('china')

In [132]:
china_topic_json = china_topic.get_topic_json()

In [134]:
china_feed_questions = china_topic_json['feed_questions']

In [138]:
china_feed_questions_name = [question['question_link'][1:].encode('utf-8') for question in china_feed_questions]
for question in china_feed_questions: print question['question_link'][1:]

In [139]:
china_feed_questions_name


Out[139]:
['How-safe-is-China',
 'How-do-foreigners-view-China-after-visiting-China',
 'Why-do-the-Chinese-still-care-about-the-Nanjing-massacre-so-much',
 'Should-China-get-out-of-Tibet-like-UK-got-out-of-Hong-Kong',
 'Why-is-China-still-so-hateful-and-rude-to-current-Japan-when-they-had-no-part-in-the-militarys-past',
 'Why-do-educated-Chinese-support-CCP-despite-not-having-the-freedom-to-criticize-Chinese-politicians',
 'How-do-foreigners-view-China-after-visiting-China',
 'What-does-\xe6\x88\x91\xe5\x8e\xbb-mean-in-Chinese',
 'What-does-it-feel-like-to-be-a-woman-living-in-China',
 'How-do-foreigners-view-China-after-visiting-China',
 'What-do-non-Chinese-Japanese-people-think-of-the-Nanjing-Massacre-2',
 'What-do-non-Chinese-Japanese-people-think-of-the-Nanjing-Massacre?no_redirect=1',
 'Why-is-it-that-people-are-saying-China-is-a-good-place-to-live-in-Millions-of-people-have-been-migrating-from-China-to-other-countries',
 'Is-Chinese-a-beautiful-language',
 'Why-dont-Chinese-people-attack-the-PLA-with-all-their-might-and-liberate-themselves',
 'Is-there-persecution-of-Muslims-in-China',
 'What-makes-the-Chinese-government-a-bad-government',
 'What-country-is-culturally-closest-to-China',
 'Why-do-so-many-foreigners-go-to-China-and-think-China-is-good',
 'How-do-foreigners-view-China-after-visiting-China',
 'Dont-people-in-China-wish-to-live-in-a-democratic-country']

In [140]:
for feed_question in china_feed_questions_name[:1]:
    print feed_question


How-safe-is-China

In [145]:
q = Question('How-safe-is-China')

In [147]:
q_json = q.get_question_json()

In [150]:
answers = q_json['answer']

In [151]:
corpus = ''
for a in answers:
    corpus = corpus+'\n'+a['answer_text']

In [153]:
corpus


Out[153]:
u'\nI have been in Beijing for more than 15 years and not once have I felt threatened in any way. Beijing have always been a safe place from my perspective. One thing that I have come to understand is that if you are a foreigner/expat in China, most locals are nice and helpful both in big cities and small towns as well. Generally, rural China is considered safe by many Chinese. Big cities, especially Beijing and Shanghai- have their headaches - pick-pocketing mostly, but generally safe. Guandong province is notoriously known for its not-so-safe problems (Police pledge to fight gangs in Guangzhou\'s townships and villages). The hotbed of identity theft, bank card hacking and copying is probably in Dongguan city also in Guangzhou.I once got my passport stolen in Shenzhen (in 2001) when dropping off the airport bus. In those days, the stops for airport buses were not regulated at all. The moment you drop-off, you get this crowd of teenagers swarming towards you with business cards and at the same time feeling your pockets for any thing they can steal. They won\'t harm you. Luckily for me, they only wanted cash to hand back my passport. I gave them 300 yuan! Today, the airport bus stops are pretty much safer than they were before in Shenzhen.It is refreshing to note that most of these incidences hardly involve foreigners and hence we feel very safe. Guns are very hard to obtain in China so the weapons of choice are knives, swords or cleavers. The government is cracking on these items as well. One thing I gather from my experience here in China is that Chinese are extremely safety oriented. Almost all doors in virtually all apartments are security doors (they call them "burglar-resisting doors") - doors a locked consistently. Most, if not all, communities are gated with security personnel around the clock and only one or less than three points of entry and exit. Incidents of some psychos, driving through kindergartens and schools, chopping kids with swords and knives have created walled schools with no more than two points of entry/exit. At public and even private establishments rarely would you find people leaving their stuff around unattended even for a quick washroom trip. Passwords are entered after looking around and with one hand blocking the view of anyone to the number pad. People are reminded of being safe on almost every opportunity: TV stations, radios, banks, communities, markets, hospitals, ATM locales (sometimes with loud annoying speakers), and LED boards are full of warnings advising people to be aware of their belongings, bank cards, locking doors and windows etc. Posters of recent robbery are distributed (locally and very discreet, if my Chinese was not good enough I will probably not notice) to warn people and to prevent recurrences. Cars are locked consistently with double checking. I was surprised when one of my neighbors kept accompanying her son to a school that was\xa0 hardly 300 meters away. When asked, she replied it was for safety reasons (apparently another kid disappeared, mysteriously, in the same area some weeks ago). There are many in China who share her reasons.Having said that, it is still common to hear few incidents of people being robbed, mugged and even murdered. Still it is safe to say that China is generally safe for expats/foreigners.\xa0 Just don\'t work, shop, dine or drive in any Japanese branded company, shop, restaurant/hotel or car when the two countries are having tensions (China protests over Japanese activists\' visit to disputed island )!\nHere is a List of countries by intentional homicide rate.It shows that China has the 27th lowest murder rate in all 218 countries and regions. And if you take a look at the 26 ahead of China, you\'ll find most of them are very small countries and cities like Hong Kong, Singapore. Japan is really safer that China. I\'ve been to Tokyo. It really feels safe to walk on the streets even in the mid night. Murder rate in US is 4.7, while the rate in China is 1.0. I\'ve been to LA and NYC. There are so few people except in Manhattan, so I have to look back and keep aware of all around when walking on the lonely streets. Once I was in the metro in LA at about lunch time, a black young man suddenly kept shouting angrily at me. I didn\'t quite understand what the hell he was talking, but some "fuck... Chinese... fuck"things. So I had to get off the train and take the next one. But I do like San Diego, it\'s miles more beautiful and people there are more friendly.However, as China is really big and has a huge and complicated population\xa0 with 55 minority nationalities, crime rates differs in regions in China. It is commonly believed that:the south is generally safer than the north. among the top10 biggest cities, Guangzhou and Shenzhen are less safer. Shanghai may be the safest.\xa0 Yangtze River Delta is the richest, humble and well-tempered region in China. You can only see two guys in Shanghai or Hangzhou quarreling, but they rarely fight. However, people\xa0 from the northeast are more likely to solve problems with fists.Sinkiang is the only dangerous province, especially in southern Sinkiang.Some places in the poor and less educated rural areas are not safe. They\'ll not kill you, but they may steal, rob or extort. For example, some guys may suddenly jump out in front of your car, lay down and than several other gangsters will surrender you extort some $2000 for medical treatment. Of course, the price is negotiable. But if you have less than $100, they may get really angry and give you a good beating. So it\'ll be wise to always have some $200 cash in your pocket.If you are an expat, you\'ll surely be safer.\xa0 The gangsters know\xa0 foreigners have little cash, because you guys always use credit cards. And if they hurt a foreigner, they\'ll be punished more seriously by the law. So\xa0 foreign guys are really not cost-effective to commit a crime on.For girls. I must say that you really have bigger boob power than most Chinese girls. So be a little low-key, if you are alone out there in byways at night or on a crowded metro train. Rapes are very few in cities, but you may be indecently assaulted or sexually harassed.\nI\u2019ve written before about why China is safe for travelers and why anyone concerned about visiting should let those inhibitions go. In terms of violent crime, you have little to worry about in China. In terms of theft, just be smart. I\u2019ve never been pick-pocketed myself, but it does happen. If you have a backpack, wear it in the front of your body when you\u2019re on public transportation.Be minimal. I suggest a money clip and using plastic as much as possible. You won\u2019t have any noticeable wallet bulge in your pants if you do things this way. And hold tight to your phone. To avoid scams, don\u2019t talk to strangers who approach you first speaking broken English, especially in shopping districts or spaces that attract a lot of tourists. If someone comes up to you, especially if you\u2019re a man, just keep moving and don\u2019t make eye contact. It might seem rude, but it\u2019s fine and they\u2019ll go away eventually. This is all minor stuff, so don\u2019t be frightened.I teach travel Chinese to people planning to visit China, and there are three other safety concerns I do remind them of before they visit.The first is traffic safety. Though traffic law enforcement is improving in big cities, it\u2019s important that you understand that in China, pedestrians are not treated with the same respect as they might be in your home country. Here are some tips:Under no circumstances should you assume a car is going to stop for you if you are walking in the street, even if the light is green for pedestrians.Remember to look both ways before crossing a road, and to continue looking as you cross. Look out for people making left turns too.The same is true when you\u2019re dealing with cyclists or people on scooters\u2014they probably aren\u2019t going to stop if they\u2019re already in motion, and they frequently ignore traffic lights altogether. You\u2019ll see people riding their bikes and scooters on sidewalks too, so keep your eyes open even when you\u2019re not in the street.Don\u2019t walk around looking at your cell phone.The second is food safety. China also has a less-than-stellar record when it comes to food safety. Tips:Though it may be tempting, I discourage you from eating street food, as there is a chance the food is being prepared with unsafe ingredients, the most common of which is recycled oil.When eating in China, stick to restaurants that are well trafficked or well reviewed. That doesn\u2019t mean you should stick to Western restaurants, it just means going to places that have a lot of visitors.That said, don\u2019t let worries prevent you from enjoying Chinese food, as it\u2019s one of the best parts of the country (here are my favorite Chinese cuisines)! Be wise and be judicious.Take risks in trying new foods, but understand that if you eat something unclean, you might get sick. In most cases, take the risk because it\u2019s worth it and you\u2019ll be fine.Bring medication in case you do fall ill.Never drink water from the tap unless it\u2019s been boiled. Restaurants will not serve you water that\u2019s not been purified through boiling or other means, so don\u2019t worry about drinking water in restaurants!And there is no such thing as fake bottled water. If it\u2019s in a bottle and the top is sealed, you\u2019re good to go.If you\u2019re visiting for a short time, I suggest following my advice on food strictly to avoid getting sick and wasting time. If you\u2019re staying longer, you can and should relax things and try to live more like a local.Finally, there\u2019s air pollution. Air pollution is simply a part of life in China. There is no way to avoid it. This is something many foreigners worry about before visiting, but my suggestion is that unless you have a condition, try not to think about it. From what I\u2019ve seen, most foreigners do not have any problems when they come, but some do cough for a little while. Understand that since you\u2019re probably only visiting, you won\u2019t be doing any lasting damage to your body by breathing normally while you\u2019re here. I think wearing a mask is overkill unless you\u2019re exercising, but it\u2019s a personal decision.Generally, you should not have any worries traveling in China. Have a safe trip!\nChina is incredibly safe! I am a Mandarin Chinese teacher of 8 years and sometimes I feel that half my job is helping foreigners settle in China. Crime is one of the things they worry about. Within a week, their worries are out the window. But, why?HOW IS THERE SO LITTLE STREET CRIME?Don\u2019t get me wrong, there is crime in China, but you\u2019re very unlikely to be a victim. \u201cStreet crime\u201d such as robbery, assault, rape and murder are astonishingly low. In large Chinese cities, I have no fear listening to my iPod and walking home through unknown neighborhoods for two hours in the middle of the night.Travelers and expats appreciate this quality over here, yet can\u2019t seem to explain exactly why it is. Rich and poor are living together. Surely, there are plenty of \u201copportunities\u201d for crime walking down the streets. So why is China so safe?Here are a few factors that likely influence the low street crime of China:THE SHAME FACTORIn the USA, South America and elsewhere, crime is often glamorized and romanticized. Many celebrities have even been caught exaggerating the length of jail time that they have actually served. Inversely from Asian culture, this criminality builds credibility and respect in the western world, and convicts may even be seen as attractive to the opposite sex.China is different.Not only are street crimes such as thievery and assault illegal, they are also shameful in Asia. The same kind of shame that comes from an abhorrent crime in the USA may be brought on by a \u201cpetty\u201d crime such as pickpocketing (in China). The shame is not only felt by the criminal, but also by his/her family, and often by the whole village. While an American may be caught recording or boasting about their assaults on the street, no one in China would think of doing this. With little glory and romance in crime, young Asians tend to aspire towards a more \u201crespectable\u201d financially lucrative career for prestige.IT\u2019S CROWDED AND URBANChina is crowded! In the USA, people often assume \u201cmore people + less space = more confrontation\u201d. Since geographical crime statistics are often difficult to discern, this attitude is debatable.Urban activist Jane Jacobs coined the phrase \u201ceyes on the street\u201d to describe why crowded and active urban streets are likely to be safer, as crime is less likely to happen with potential witnesses and everyday heroes that could step in and help.Since Asian and Chinese cities are filled with convenience stores, shopfronts and street food vendors, there are an abundance of eyes on the street to keep one safe on the sidewalk.GENETICSThis would surely be a controversial hypothesis. Many scientists now believe that around 50% of our behavior is based on the DNA we\u2019re born with, while 50% is based on our environment. Therefore, our genes are built on experience from our evolutionary past. This is called the \u201c50-0-50\u201d rule (\u20180\u2019 actually representing parental influence).Since China was among the earliest civilizations, and still prospering today, the genetics have been passed down from generation to generation to be harmonious.RESPECT FOR AUTHORITYWith respect and adherence to authority, Chinese citizens are less likely to be a nuisance.Authority can be a government, an employer, or a family. With so many eyes on you, all with high expectations, you\u2019re more likely to grow up to be self-conscious and cooperative.LACK OF SINGLE PARENT FAMILIESTwo-thirds of young criminals in the USA come from single-parent, usually fatherless, families.In China, marriage is often based on a rational compatibility, not love or spontaneity. Couples won\u2019t marry because it sounds like an exciting idea, but rather because it makes the most sense for their future and for their respective families. Once children are born, family members generally assume a role and adhere to it. If there is stress in the family, the parents are more likely to unhappily stick it out to survive, putting others ahead of them.CONFUCIANISM\u201cIf you govern by regulations and keep them in order by punishment, the people will avoid trouble but have no sense of shame. If you govern them by moral influence, and keep them in order by a code of manners, they will have a sense of shame and will come to you of their own accord.\u201dConfucius advocated that punishment should take the form of social ostracism, rather than forced suffering. These beliefs still persist today. Confucianism is not a religion, but rather an ethical and philosophical system, which has endless applications within a society. Confucius, the bearded Yoda of ancient China, advocated relationships based on mutual respect and piety, but also strict hierarchy and adherence to law.Even in today\u2019s ever-changing Asia, Confucius still has a great influence. Increasingly, \u201cConfucian Classrooms\u201d are operating in Chinese prisons, rehabilitating inmates by understanding societal harmony and Chinese history. Today, many Chinese are living their daily lives with little knowledge of laws and little contact with the police. However, they are disciplined within their communities by the invisible laws of Confucianism.COOPERATION WITH POLICEIn the US, due to a distrust or resentment of the police, crimes often are carried out with no arrests, as it is difficult to persuade citizens to cooperate and speak to the police. In China, there is a lot of cooperation between police and citizens. This helps lead to convictions.Believe me, follow the rules and you will have a safe and pleasant trip in China!\nThis Is probably the country where I feel the safest (with Singapore).i have been living in China for a while now and never had any problem apart pickpocket one time.The only time It had been hot was with one of our supplier who didn\'t want to rework some goods he failed quality control. Otherwise I never have experienced any problem.A good thing in China is safety, get out in the middle of the night the risk to get trouble is extremely low. I have been living in Paris and in the usa and it was much more dangerous there. In Paris you can not get out your smarrphone in the metro \u2026unsafe.China may be criticized for many things regarding human right etc\u2026.but I have to admit that their strictness about crime bring for people who are behaving properly a certain piece of mind. They don\'t joke with crime. They can jail you for several months if you steal and no need a big amount of money to be sentenced 6 months (And this is not hotel style from what I heard)So generally speaking people are not playing too much when it is related to physical safety. I don\'t know if the fact I am foreigner there has an influence or not (I suppose yes a bit as I heard also some stories of Chinese people getting threaten by other Chinese at ATM or by apartment robery)What is a bit unsafe in China however are cars and bus: they never let you cross street as pedestrian and it can become very dangerous if you try to play against it.'

In [ ]: