In the management of the online public opinion and Internet intelligent information, people need to obtain the content of the forum threads for further research on the topic emotion and the dissemination of forum topics. This paper presents a method based on templates to extract web forum contents. Proposed method overcomes the problem which caused by the change of the web pages structures and contents, and can extract the content effectively. In this method, web pages are translated into DOM (Document Object Model) tree which will be matched by the templates. In cases when it doesn't match, Fuzzy matching and repetition matching is used. Finally the web pages contents are extracted and obtained. The experiment shows that this method has a better accuracy and recall rate.