Such as the above! I just grab "liaoning",
I test for a long time, has been an error, I don't know why!
I am a little white, so give great god specifically solution! Thank you very much!
CodePudding user response:
The code you write is regular you can write (" area "? <=address:). *? (?=)Are you want to do any provinces identify cpca look at this bag is suitable for the python3 https://github.com/DQinYuan/chinese_province_city_area_mapper
CodePudding user response:
Thank you very much! Cpca very powerful wow!But I just caught the provinces, and the provinces entry in the table! In the end I wrote like this:
FindDiqu=re.com from running (r 'Beijing chongqing | | | | Shanghai tianjin hebei | | | in Inner Mongolia, shanxi liaoning jilin | | fujian | | | | | in anhui, zhejiang, jiangsu heilongjiang province shandong jiangxi | | | | | | hubei hunan guangdong, guangxi, henan | | | | | guizhou sichuan hainan yunnan Tibet | | | | | qinghai gansu shaanxi ningxia xinjiang')
Diqu=findDiqu. Search (total)
If diqu is None:
Print (' not found provinces')
DiquNew='
The else:
DiquNew=diqu. Group ()
Basic solved my needs! Just some address have no above the garage! Such as many address directly: mianyang city * * * * * so take less than it is to belong to the sichuan! But now that affect my work also is not very big,
CodePudding user response:
You're welcome, for example, you * * * * * this lack of mianyang, address cpca actually can also directly out of sichuan is very convenient and practical