add:http://stackoverflow.com/questions/10619549/unicode-findall-python
selenium中获得的是unicode的,要环视查找对应的\d+
内容,谢谢这位,问题相同我的也ok了.
allpagenum_css="#pagelist>ul>li:last-child"
num_allpagenum=self.driver.find_element_by_css_selector(allpagenum_css).text
print "num_allpagenum is %s" % num_allpagenum
print re.findall(ur"(?<=共)\d+",num_allpagenum)
[popexizhi:ur有顺序要求吧?vim对ru很郁闷的没有相同的颜色修改:).我倒是没查]
selenium中获得的是unicode的,要环视查找对应的\d+
内容,谢谢这位,问题相同我的也ok了.
allpagenum_css="#pagelist>ul>li:last-child"
num_allpagenum=self.driver.find_element_by_css_selector(allpagenum_css).text
print "num_allpagenum is %s" % num_allpagenum
print re.findall(ur"(?<=共)\d+",num_allpagenum)
[popexizhi:ur有顺序要求吧?vim对ru很郁闷的没有相同的颜色修改:).我倒是没查]
没有评论:
发表评论