文本scraper的基本python语法错误

时间:2014-02-11 18:49:29

标签: python python-3.x scraper

我最近升级到Python 3.3并开始遇到问题。语法错误位于最底部的m.group(1)的“m”。知道怎么解决?感谢

# Open the local file
fo = open("Text.txt")

# read the file - this assumes it is the first line
line = fo.readline() 

# close the file
fo.close()

# Use a regular expression to find the specific groups
import re
mos = re.finditer(r"value=\\'([\d.]+)\\'", line)

for m in mos:
print m.group(1)

0 个答案:

没有答案