Fortune Telling Collection - Comprehensive fortune-telling - How to match Chinese characters with regular expressions?
How to match Chinese characters with regular expressions?
In general, you can match Chinese in this way, as shown in the figure:&; amplt; img src = "/50/edcbd 2 faf 1a 9 1 6675 CEC 852 BD 886 e 599 _ HD . jpg " data-raw width = " 827 " data-raw height = " 600 " class = " origin _ image zh-light box-thumb " width = " 827 " data-o riginal = "/edcbd 2 faf 1a 9 1675 CEC 852 BDampgt;
First find this soup or regular node, and then match it with the above character group.
Assuming that there is only one node, the usage is as follows:
Import the re-import request as required from bs4 import beautiful soup URL =' XXX' html = req.get (URL). textbs = beautiful soup(html)span = bs . find _ all(' span ',' pro-title ')' ' ' span = re . find all(& lt; span\sclass="pro-title " >【^<; ]+& lt; /span & gt;' ,html)s = span[0]m = re . find all('[\ u4e 00-\ u9fa 5]+',s)' ' ' s = str(span)m = re . find all('[\ u4e 00-\ u9fa 5]+',s)print(m)
- Previous article:What does a fortune-telling doll mean?
- Next article:Wu Zhuang Fortune Telling _ Wu Qiao Fortune Telling
- Related articles
- Lintao chicken fortune telling
- What is Guan Gong's pendant for?
- If the heart is the sea and everything is the sea, what does the Buddha mean?
- Imitating Northeast Fortune Telling _ A Real Case of Northeast Fortune Tellers
- Named fortune teller _ named fortune teller?
- Fortune-telling of Maofeng Mountain in Guangzhou _ Legend of Maofeng Mountain Ancient Temple in Guangzhou
- 1987 male fortune teller
- What do dimples stand for?
- 20 12 what about the little girl born on June 8? Her name is Zhang Tingting.
- I heard that the origin of xiuying port in Haikou is the name of a warlord's little wife, but I don't want to know more about it. Thank you!