This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<p>Hello ${name}! You have the following messages: | |
<#list messages as m> | |
<p><b>${m.from}:</b> ${m.body}</p> | |
</#list> | |
</p> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<p>Hello Joe! You have the following messages: | |
<p><b>Tim:</b> Please don't forget to bring the conference papers!</p> | |
<p><b>Cindy:</b> Can you give me a visit this afternoon?</p> | |
<p><b>Richard:</b> Don't forget the papers this time!</p> | |
</p> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--**************************** Freemarker ************************************ --> | |
<servlet> | |
<servlet-name>freemarker</servlet-name> | |
<servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class> | |
<!-- | |
Init-param documentation: | |
http://freemarker.org/docs/api/freemarker/ext/servlet/FreemarkerServlet.html | |
--> | |
<!-- FreemarkerServlet settings: --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:util="http://www.springframework.org/schema/util" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
http://www.springframework.org/schema/context | |
http://www.springframework.org/schema/context/spring-context-3.0.xsd | |
http://www.springframework.org/schema/util |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--**************************** Sitemesh ************************************ --> | |
<filter> | |
<filter-name>sitemesh</filter-name> | |
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> | |
</filter> | |
<filter-mapping> | |
<filter-name>sitemesh</filter-name> | |
<url-pattern>/*</url-pattern> | |
</filter-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<decorators defaultdir="/WEB-INF/decorators"> | |
<decorator name="main3" page="main3.dec"> | |
<pattern>/updatefood.htm</pattern> | |
<pattern>/updatefood0.htm</pattern> | |
</decorator> | |
<decorator name="main2" page="main2.dec"> | |
<pattern>/addfood.htm</pattern> | |
</decorator> | |
<decorator name="main" page="main.dec"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import urllib2 library 用作 query 網頁 | |
import urllib2 | |
#指定需要提取資料的頁面 | |
locatefamily = "http://www.locatefamily.com/Street-Lists/Hong-Kong/index-1.html" | |
#用 urllib2 提取有關頁面的 html | |
page = urllib2.urlopen(locatefamily) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import Beautiful soup 用作 parse 回傳頁面的 html | |
from bs4 import BeautifulSoup | |
# 用 Beautiful soup 來 parse 回傳頁面的 html | |
soup = BeautifulSoup(page, "html.parser") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
right_tables=soup.findAll('table', class_='table') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Generate lists | |
A=[] | |
B=[] | |
C=[] | |
D=[] | |
E=[] | |
for table in right_tables: | |
for body in table.findAll("tbody"): | |
for row in body.findAll("tr"): |
OlderNewer