In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to use Python regular expressions to identify landlords. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
Identify the owner of the building:
Post code snippet:
Var chrType = "public"; var intAuthorId = ""; var chrAuthorName = "GreyHouse"; var chrTitle = "[light and shadow record] flea's trip to Europe"; var chrItem = 'travel'; var intItem =' 0mm; var intArticleId = "191157"; var tAuthor = 'GreyHouse'
Use the following Python regular expression to find the landlord:
Rereg_louzhu = re.compile ('. * chrAuthorName = "(. *?)";'
Set mat to reg_louzhu.match (html line of the source code of the web page), then mat.groups () [0] is the main name of the building GreyHouse
Identify the starting position of a post
Continue to analyze html and find that Tianya replies generally use the author information bar as the beginning of the post, so the end of the post is before the next author information bar.
Author: shopping in a tank
The above is how to use Python regular expression to identify the landlord. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.