Skip to content

Commit 158bb78

Browse files
committed
parserHTML by HTMLParser
1 parent aa61f7b commit 158bb78

File tree

94 files changed

+3211
-2603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3211
-2603
lines changed

.metadata/.log

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,3 +1887,79 @@ Binding(CTRL+SHIFT+T,
18871887
,,true),null),
18881888
org.eclipse.ui.defaultAcceleratorConfiguration,
18891889
org.python.pydev.ui.editor.scope,,,system)
1890+
!SESSION 2014-02-25 21:38:04.767 -----------------------------------------------
1891+
eclipse.buildId=4.3.0.M20130911-1000
1892+
java.version=1.7.0_45
1893+
java.vendor=Oracle Corporation
1894+
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
1895+
Framework arguments: -product org.eclipse.epp.package.jee.product
1896+
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product
1897+
1898+
!ENTRY org.eclipse.rse.core 4 0 2014-02-25 21:39:49.936
1899+
!MESSAGE Unexpected Exception
1900+
!STACK 0
1901+
java.net.UnknownHostException: pluto: pluto
1902+
at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
1903+
at org.eclipse.rse.core.RSECorePlugin.getLocalMachineName(RSECorePlugin.java:265)
1904+
at org.eclipse.rse.core.RSEPreferencesManager.getDefaultPrivateSystemProfileName(RSEPreferencesManager.java:358)
1905+
at org.eclipse.rse.core.RSEPreferencesManager.initDefaults(RSEPreferencesManager.java:337)
1906+
at org.eclipse.rse.internal.core.RSEPreferenceInitializer.initializeDefaultPreferences(RSEPreferenceInitializer.java:23)
1907+
at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:300)
1908+
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
1909+
at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.runInitializer(PreferenceServiceRegistryHelper.java:303)
1910+
at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:131)
1911+
at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
1912+
at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:221)
1913+
at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:274)
1914+
at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:409)
1915+
at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:670)
1916+
at org.eclipse.core.internal.preferences.DefaultPreferences.node(DefaultPreferences.java:147)
1917+
at org.eclipse.core.internal.preferences.legacy.PreferenceForwarder.getDefaultPreferences(PreferenceForwarder.java:130)
1918+
at org.eclipse.core.internal.preferences.legacy.PreferenceForwarder.getInt(PreferenceForwarder.java:469)
1919+
at org.eclipse.rse.logging.Logger.initialize(Logger.java:249)
1920+
at org.eclipse.rse.logging.Logger.<init>(Logger.java:135)
1921+
at org.eclipse.rse.logging.LoggerFactory.getLogger(LoggerFactory.java:45)
1922+
at org.eclipse.rse.core.RSECorePlugin.getLogger(RSECorePlugin.java:392)
1923+
at org.eclipse.rse.internal.core.RSEInitJob.<init>(RSEInitJob.java:130)
1924+
at org.eclipse.rse.internal.core.RSEInitJob.<clinit>(RSEInitJob.java:62)
1925+
at org.eclipse.rse.internal.ui.RSEUIStartup.earlyStartup(RSEUIStartup.java:19)
1926+
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
1927+
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
1928+
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
1929+
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2551)
1930+
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
1931+
Caused by: java.net.UnknownHostException: pluto
1932+
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
1933+
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
1934+
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
1935+
at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
1936+
... 28 more
1937+
1938+
!ENTRY org.eclipse.jface 2 0 2014-02-25 23:24:32.711
1939+
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
1940+
!SUBENTRY 1 org.eclipse.jface 2 0 2014-02-25 23:24:32.711
1941+
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
1942+
Binding(CTRL+SHIFT+T,
1943+
ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
1944+
Open a type in a Java editor,
1945+
Category(org.eclipse.ui.category.navigate,Navigate,null,true),
1946+
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5b921738,
1947+
,,true),null),
1948+
org.eclipse.ui.defaultAcceleratorConfiguration,
1949+
org.eclipse.ui.contexts.window,,,system)
1950+
Binding(CTRL+SHIFT+T,
1951+
ParameterizedCommand(Command(com.python.pydev.analysis.actions.pyGlobalsBrowserWorkbench,Python Show Global Tokens (Global),
1952+
Python Show Global Tokens (Global),
1953+
Category(org.python.pydev.ui.category.source,PyDev - Editor,PyDev editor category,true),
1954+
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@54328c7f,
1955+
,,true),null),
1956+
org.eclipse.ui.defaultAcceleratorConfiguration,
1957+
com.python.pydev.contexts.window,,,system)
1958+
Binding(CTRL+SHIFT+T,
1959+
ParameterizedCommand(Command(org.python.pydev.editor.actions.pyShowBrowser,Python Show Global Tokens (Editor),
1960+
Python Show Global Tokens (Editor),
1961+
Category(org.python.pydev.ui.category.source,PyDev - Editor,PyDev editor category,true),
1962+
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@42a61108,
1963+
,,true),null),
1964+
org.eclipse.ui.defaultAcceleratorConfiguration,
1965+
org.python.pydev.ui.editor.scope,,,system)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
4+
#演示通过HTMLParser解析并处理特定的HTML标签
5+
import HTMLParser
6+
class ParserForm(HTMLParser):
7+
def handle_starttag(self,tag,attrs):
8+
if(tag == "form"):
9+
print tag,attrs
10+
11+
12+
if __name__ == '__main__':
13+
print "演示通过HTMLParser解析特定的HTML标签"
14+
strs ="""
15+
<html>
16+
<head>
17+
<title>this is tile</title>
18+
</head>
19+
<body>
20+
<form action="help.php" method="post">
21+
username:<input type="text" id="name"></input>
22+
</form>
23+
</body>
24+
</html>
25+
"""
26+
ph_parser = ParserForm()
27+
ph_parser.feed(strs)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
#演示通过HTMLParser解析HTML文件
4+
from HTMLParser import HTMLParser
5+
6+
#从HTMLParser类集成一些有用的方法
7+
class FirstHTMLParser(HTMLParser):
8+
def handle_starttag(self, tag, attrs):
9+
print "a start tag:",tag
10+
def handle_endtag(self,tag,attrs):
11+
print "a end tag:",tag
12+
def handle_data(self,data):
13+
print "some data",data
14+
if __name__ == '__main__':
15+
html_parser = FirstHTMLParser()
16+
html_parser.feed("")

.metadata/.plugins/org.eclipse.core.resources/.history/54/90a1b31c6c9d001317d5a6d09c87e33c

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
#演示通过HTMLParser解析HTML文件
4+
from HTMLParser import HTMLParser
5+
if __name__ == '__main__':
6+
pass
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
4+
#演示通过HTMLParser解析并处理特定的HTML标签
5+
import HTMLParser
6+
class ParserForm(HTMLParser):
7+
def handle_starttag(self,tag,attr):
8+
if(tag == "form"):
9+
print tag,attr
10+
if __name__ == '__main__':
11+
print "演示通过HTMLParser解析特定的HTML标签"
12+
strs ="""
13+
<html>
14+
<head>
15+
<title>this is tile</title>
16+
</head>
17+
<body>
18+
<form action="help.php" method="post">
19+
username:<input type="text" id="name"></input>
20+
</form>
21+
</body>
22+
</html>
23+
"""
24+
ph_parser = ParserForm()
25+
ph_parser.feed(strs)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
4+
#演示通过HTMLParser解析并处理特定的HTML标签
5+
from HTMLParser import HTMLParser
6+
class ParserForm(HTMLParser):
7+
def handle_starttag(self,tag,attrs):
8+
if(tag == "form"):
9+
print tag,attrs
10+
11+
12+
if __name__ == '__main__':
13+
print "演示通过HTMLParser解析特定的HTML标签"
14+
ph_parser = ParserForm()
15+
ph_parser.feed("""
16+
<html>
17+
<head>
18+
<title>this is tile</title>
19+
</head>
20+
<body>
21+
<form action="help.php" method="post">
22+
username:<input type="text" id="name"></input>
23+
</form>
24+
</body>
25+
</html>
26+
""")
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
4+
#演示通过HTMLParser解析并处理特定的HTML标签
5+
from HTMLParser import HTMLParser
6+
class ParserForm(HTMLParser):
7+
def handle_starttag(self,tag,attrs):
8+
if(tag == "form"):
9+
print "标签命:",tag
10+
print "属性=》attr‘s type:",type(attrs)
11+
print attrs.method
12+
13+
14+
if __name__ == '__main__':
15+
print "演示通过HTMLParser解析特定的HTML标签"
16+
ph_parser = ParserForm()
17+
ph_parser.feed("""
18+
<html>
19+
<head>
20+
<title>this is tile</title>
21+
</head>
22+
<body>
23+
<form action="help.php" method="post">
24+
username:<input type="text" id="name"></input>
25+
</form>
26+
</body>
27+
</html>
28+
""")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
4+
#演示通过HTMLParser解析并处理特定的HTML标签
5+
import HTMLParser
6+
class ParserForm(HTMLParser):
7+
def handle_starttag(self,tag,attr):
8+
if(tag == "form"):
9+
print tag,attr
10+
if __name__ == '__main__':
11+
pass
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#! /usr/bin/python
2+
#coding:UTF-8
3+
4+
#演示通过HTMLParser解析并处理特定的HTML标签
5+
import HTMLParser
6+
class ParserForm(HTMLParser):
7+
if __name__ == '__main__':
8+
pass

0 commit comments

Comments
 (0)